- 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
commit 85a3cd984d
2 changed files with 39 additions and 45 deletions

View file

@ -88,17 +88,11 @@ 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);
}
x = new FxIntCast(x);
}
else
{
if (x->ValueType != VAL_Float)
{
x = new FxFloatCast(x);
}
x = new FxFloatCast(x);
}
}
else if (type == TypeName || type == TypeString)