- fixed: ParseParameter should not make any assumptions about the necessity of a type cast between int and float.

With late resolving it cannot be guaranteed at this point and caused some incorrectly compiled code. Since the cast gets optimized away anyway when not needed there's no point being this selective with applying it.
This commit is contained in:
Christoph Oelckers 2016-02-10 17:06:33 +01:00
parent a7254a4af5
commit 85a3cd984d
2 changed files with 40 additions and 46 deletions

View file

@ -87,20 +87,14 @@ FxExpression *ParseParameter(FScanner &sc, PClassActor *cls, PType *type, bool c
}
// Do automatic coercion between ints and floats.
if (type == TypeSInt32)
{
if (x->ValueType != VAL_Int)
{
x = new FxIntCast(x);
}
}
else
{
if (x->ValueType != VAL_Float)
{
x = new FxFloatCast(x);
}
}
}
else if (type == TypeName || type == TypeString)
{
sc.SetEscape(true);