Skip Menu |
Report information
Id: 130775
Status: new
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: bartolin [at]

Severity: (no value)
Tag: (no value)
Platform: (no value)
Patch Status: (no value)
VM: (no value)

Date: Mon, 13 Feb 2017 21:18:33 +0100
Subject: [JVM] Problems with 'with' and attached block
From: Christian Bartolomaeus <bartolin [...]>
To: rakudobug [...]
Download (untitled) / with headers
text/plain 875b
The blockless form of 'with' works as expected on JVM, but there are some wrong results if there is a block attached to a 'with' condition: <bartolin> r: say 42 with Empty <camelia> rakudo-moar aac9ef, rakudo-jvm fb4f16: ( no output ) <bartolin> r: with Empty { say 42 } <camelia> rakudo-moar aac9ef: ( no output ) <camelia> ..rakudo-jvm fb4f16: OUTPUT«42␤» Same thing happens with Failure and an actual Failure: <bartolin> r: with { say 42 } <camelia> rakudo-moar aac9ef: ( no output ) <camelia> ..rakudo-jvm fb4f16: OUTPUT«42␤» <bartolin> r: say 42 with <camelia> rakudo-moar aac9ef, rakudo-jvm fb4f16: ( no output ) There are fudged tests in S04-statements/with.t for this problem and a newly added test in S03-smartmatch/any-num.t fails for the same reason. I'm going to add the number of this ticket to those tests.
RT-Send-CC: perl6-compiler [...]
Download (untitled) / with headers
text/plain 791b
I think I know what happens. On MoarVM we call the Perl 6 method 'defined': On JVM we test for concreteness (like nqp::isconcrete would do): 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' False $ ./perl6-j -e 'use nqp; say nqp::isconcrete(Empty)' 1 $ ./perl6-j -e 'say' False $ ./perl6-j -e 'use nqp; say nqp::isconcrete(' 1 It looks like the implementation of 'with' needs some refinement on JVM.

This service is sponsored and maintained by Best Practical Solutions and runs on infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at