HaxeFoundation / haxe

Haxe - The Cross-Platform Toolkit
https://haxe.org
6.03k stars 648 forks source link

[hl] Fix NotEq compare nullInt with Int #11629

Closed yuxiaomao closed 3 months ago

yuxiaomao commented 3 months ago

The following code does not return the expected result on local (it print false, false), and this PR fix it.

static function main() {
    var nullInt:Null<Int> = null;
    trace(nullInt != 0); // expect: true
    trace(nullInt != 6); // expect: true
}

However, CI is green and place this code in TestOps.hx does not cause any problem (it print true, true but it shouldn't); try.haxe does not fail either. That's very strange and I don't understand why :(

Simn commented 3 months ago

This could come from optimization "fixing" it.

yuxiaomao commented 3 months ago

Oh! You're right, it produce(d) error when I added @:analyzer(ignore). Just in case I will put it to the class

yuxiaomao commented 3 months ago

It seems that github has some connection issues today? I'll try rerun it later