-
-
Notifications
You must be signed in to change notification settings - Fork 658
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[jvm][java] ClassCastException when casting to String #9585
Comments
This doesn't actually reproduce for me with genjava, only with genjvm. Not quite sure why though, because the dump reveals that all these Given that |
Never mind, I had the The reason this doesn't fail on genjava (and hxcpp (and probably gencs)) is because the local initialization itself is cast: java.lang.String value1 = haxe.lang.Runtime.toString(_Main.Main_Fields_.getFloat());
java.lang.String value2 = haxe.lang.Runtime.toString(_Main.Main_Fields_.getInt());
java.lang.String value3 = haxe.lang.Runtime.toString(_Main.Main_Fields_.getBool());
java.lang.String value4 = haxe.lang.Runtime.toString(_Main.Main_Fields_.getArray());
java.lang.String value5 = haxe.lang.Runtime.toString(_Main.Main_Fields_.getObject()); HXLINE( 23) ::String value1 = ( (::String)(::_Main::Main_Fields__obj::getFloat()) );
HXLINE( 24) ::String value2 = ( (::String)(::_Main::Main_Fields__obj::getInt()) );
HXLINE( 25) ::String value3 = ( (::String)(::_Main::Main_Fields__obj::getBool()) );
HXLINE( 26) ::String value4 = ( (::String)(::_Main::Main_Fields__obj::getArray()) );
HXLINE( 27) ::String value5 = ( (::String)(::_Main::Main_Fields__obj::getObject()) ); This is somewhat consistent with how our type inference works with regards to |
This case results in a ClassCastException. Uncommenting the explicit
:Dynamic
types fixes the crash, but I'm not sure why and I figure it might be a compiler bug?Thanks!
The text was updated successfully, but these errors were encountered: