haxe icon indicating copy to clipboard operation
haxe copied to clipboard

Throw "String" wrapped into haxe.ValueException but native field's type difference

Open filt3rek opened this issue 8 months ago • 8 comments

Hej,

With this sample : https://try.haxe.org/#4Aa92c24

class Test {
	static function main() {
		try {
			throw "Foo";
		} catch (e) {
   		  	trace( Type.typeof( e ) );
    		  	trace( e.native );
    		  	trace( Type.typeof( e.native ) );
		}
	}
}

We got these results :

  • Haxe 4.3.6
    • JS :
      • haxe.ValueException
      • "Foo"
      • haxe.ValueException
    • Neko :
      • haxe.ValueException
      • "Foo"
      • String
    • Eval :
      • haxe.ValueException
      • "Foo"
      • String
    • HL : Build Error
  • Haxe 4.3.6 - d688fdf74
    • JS :
      • haxe.ValueException
      • "Foo"
      • haxe.ValueException
    • Neko :
      • haxe.ValueException
      • "Foo"
      • String
    • Eval :
      • haxe.ValueException
      • "Foo"
      • String
    • HL :
      • haxe.ValueException
      • "Foo"
      • String
  • Haxe Developpment - 7ba8e17 :
    • JS :
      • haxe.ValueException
      • "Foo"
      • haxe.ValueException
    • Neko :
      • haxe.ValueException
      • "Foo"
      • haxe.ValueException
    • Eval :
      • haxe.ValueException
      • "Foo"
      • haxe.ValueException
    • HL :
      • haxe.ValueException
      • "Foo"
      • haxe.ValueException

Is it normal that native's type is also haxe.ValueException ? Won't it be like circular refs here or something infinite using previous/native ? And are these changes planned for the next 4.3.x release please ?

Thanks for reading !

filt3rek avatar Mar 15 '25 18:03 filt3rek