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] nqp::attrinited does not work for natives #446
Comments
|
For the record: I tried to make 'is required' work with native attributes, but didn't really find a solution. Maybe my findings are usefull for someone else (or for a later myelf), so I'm writing down my results. For native strings, the following patch seems to help (didn't run full spectest): AFAIU the problem with native ints and nums is, that instances of long or double in Java get a default value of 0. It's not possible to use an IFNULL check as above and testing for a value of zero would give wrong results if the attribute is really initialized with a value of zero. |
|
As a status update: The test in S11-compunit/compunit-dependencyspecification.t is passing now, but the code examples from the original report are still working differently on the JVM backend. |
The nqp::attrinited op always returns 1 for native attributes on the JVM backend.
This also leads to trait 'is required' not failing if a native attribute is not initialized. (That problem leads to a failing spectest, btw: https://github.com/perl6/roast/blob/d86f648fb87fcf9df457c7aaffd804cdfb64249c/S11-compunit/compunit-dependencyspecification.t#L6).
The text was updated successfully, but these errors were encountered: