- 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:
parent
a7254a4af5
commit
85a3cd984d
2 changed files with 39 additions and 45 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue