Fixed Avoid Error Implicit coercion of a value of type XXX to an unrelated type YYY

This commit is contained in:
Jindra Petřík
2022-11-27 16:28:40 +01:00
parent a99df959bc
commit c26030620f
10 changed files with 77 additions and 5 deletions

View File

@@ -66,6 +66,7 @@ package
TestIfInIf;
TestIfTry;
TestIgnoreAndOr;
TestImplicitCoerce;
TestImportedVar;
TestInc2;
TestIncDec;

View File

@@ -0,0 +1,22 @@
package tests
{
public class TestImplicitCoerce
{
public function run():void
{
var j:int = 2;
var i:int = 5;
var r:* = Math.random();
if (j & Number(r == 1) && 5) {
trace("OK");
}
var s:String = "hello: " + r;
if (s){
trace("F");
}
}
}
}