Skip to content

Commit

Permalink
ScriptEditor: Allow assignment of BioDeprecated class to any class pr…
Browse files Browse the repository at this point in the history
…operty in property blocks, with warning.
  • Loading branch information
SirCxyrtyx committed Oct 28, 2023
1 parent 6ecde91 commit 6101bef
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,14 @@ private void VerifyLiteral(VariableType targetType, ref Expression literal)
}
else if (targetClassLimiter.ClassLimiter != literalClassType.ClassLimiter && !((Class)literalClassType.ClassLimiter).SameAsOrSubClassOf(targetClassLimiter.ClassLimiter.Name))
{
TypeError($"Cannot assign a value of type '{literalClassType.DisplayName()}' to a variable of type '{targetClassLimiter.DisplayName()}'.", literal);
if (literalClassType.ClassLimiter.Name is "BioDeprecated")
{
LogWarning("Use of BioDeprecated! If this is pre-existing it's probably fine, but do not write new code like this.");
}
else
{
TypeError($"Cannot assign a value of type '{literalClassType.DisplayName()}' to a variable of type '{targetClassLimiter.DisplayName()}'.", literal);
}
}
}

Expand Down

0 comments on commit 6101bef

Please sign in to comment.