Closed sushihangover closed 9 years ago
as/test-as-CS0172-IntDoubleConditional.as as/test-as-CS0172-UIntDoubleConditional.as
// Compiler options: -psstrict+
package {
public class Foo {
public static function Main():int {
var val:int = 1;
var num:Number = 1.2345;
// The following SHOULD NOT report this:
// error CS0172: Type of conditional expression cannot be determined
// as `int' and `double' convert implicitly to each other
// but should in C#
var y:Number = ( num < 1.987 ) ? val : num;
var z:Number = ( num < 1 ) ? val : val * num;
return 0;
}
}
}
// Compiler options: -psstrict+
package {
public class Foo {
public static function Main():int {
var val:uint = 1;
var num:Number = 1.2345;
var i:int;
// The folliwing SHOULD NOT report this:
// error CS0172: Type of conditional expression cannot be determined
// as `uint' and `int' convert implicitly to each other
// but should in C#
var y:Number = ( num < 1.987 ) ? val : num;
var z:Number = ( num < 1 ) ? val : val * num;
return 0;
}
}
}
commit 8c17ec00a5cc83c647e54415398bd6d8b894e499 Author: SushiHangover sushihangover@outlook.com Date: Fri Aug 14 23:22:23 2015 -0700
Fixes #60 : conditional expression implicit conversions
Regression from away3d-core-monomac:
In: