- relaxed the message for incompatible class types in DECORATE to a warning. Like finding no class at all here, this initially fell under a situation that was not discoverable and there's mods that break by making it a fatal error.

This commit is contained in:
Christoph Oelckers 2016-11-15 15:34:00 +01:00
parent 97e643c7e1
commit 77a99890cf

View file

@ -8069,11 +8069,10 @@ FxExpression *FxClassTypeCast::Resolve(FCompileContext &ctx)
{ {
if (!cls->IsDescendantOf(desttype)) if (!cls->IsDescendantOf(desttype))
{ {
ScriptPosition.Message(MSG_ERROR, "class '%s' is not compatible with '%s'", clsname.GetChars(), desttype->TypeName.GetChars()); ScriptPosition.Message(MSG_OPTERROR, "class '%s' is not compatible with '%s'", clsname.GetChars(), desttype->TypeName.GetChars());
delete this; cls = nullptr;
return nullptr;
} }
ScriptPosition.Message(MSG_DEBUGLOG, "resolving '%s' as class name", clsname.GetChars()); else ScriptPosition.Message(MSG_DEBUGLOG, "resolving '%s' as class name", clsname.GetChars());
} }
} }
FxExpression *x = new FxConstant(cls, to, ScriptPosition); FxExpression *x = new FxConstant(cls, to, ScriptPosition);