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
Problems with 'with' and attached block #6070
Comments
From @usev6The blockless form of 'with' works as expected on JVM, but there are <bartolin> r: say 42 with Empty <bartolin> r: with Empty { say 42 } Same thing happens with Failure and an actual Failure: <bartolin> r: with Failure.new { say 42 } <bartolin> r: say 42 with Failure.new There are fudged tests in S04-statements/with.t for this problem and a |
From @usev6I think I know what happens. On MoarVM we call the Perl 6 method 'defined': https://github.com/perl6/nqp/blob/ac9a66abad13a7fd3d52b22ba533a9f8436ad1ac/src/vm/moar/QAST/QASTOperationsMAST.nqp#L787 On JVM we test for concreteness (like nqp::isconcrete would do): https://github.com/perl6/nqp/blob/ac9a66abad13a7fd3d52b22ba533a9f8436ad1ac/src/vm/jvm/QAST/Compiler.nqp#L802 And then there are special versions of 'method defined' for Slip and Failure which are missed on JVM when testing for concreteness only: $ ./perl6-j -e 'say Empty.defined' $ ./perl6-j -e 'use nqp; say nqp::isconcrete(Empty)' $ ./perl6-j -e 'say Failure.new.defined' $ ./perl6-j -e 'use nqp; say nqp::isconcrete(Failure.new)' It looks like the implementation of 'with' needs some refinement on JVM. |
Just some more context:
|
... instead of 'isconcrete'. I'm not sure if my usage of InvokeDynamic is the right way to call the found 'method defined', but it seems to improve the situation a lot. Even if there are still two broken tests (maybe &boolify_instructions need a tweak, too): This patch makes the other NQP tests for with/without pass and it helps with two open issues: * Raku/old-issue-tracker#6070 * rakudo/rakudo#4354
The problem has been fixed with Raku/nqp#734. I've unfudged the tests in roast with Raku/roast@f7810e8018. |
Migrated from rt.perl.org#130775 (status was 'new')
Searchable as RT130775$
The text was updated successfully, but these errors were encountered: