Everything is an expression?

Hej,

I continue flooding the forum with experiments…
While everithing is an expression in Haxe, why this example doesn’t work please ? Try Haxe !

class Test {
	static function main() {
    if( { 1; } != null ) trace( "ok" );		// <--- Doesn't work
    if( ({ 1; }) != null ) trace( "ok" );	// <--- Do work
	}
}

Looks like an oversight in the Haxe parser. You can submit an issue.

Closed as fast as written :rofl: https://github.com/HaxeFoundation/haxe/issues/10588
I even don’t rellay understand the explanation because I thought ECall was different from EParenthesis…
Anyway, for my needs, I add parenthesis in expr iterations … :confused:

1 Like