Skip to content
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

can't have sub as implicit return of sub #4701

Closed
p6rt opened this issue Oct 31, 2015 · 7 comments
Closed

can't have sub as implicit return of sub #4701

p6rt opened this issue Oct 31, 2015 · 7 comments
Labels
JVM Related to Rakudo-JVM

Comments

@p6rt
Copy link

p6rt commented Oct 31, 2015

Migrated from rt.perl.org#126517 (status was 'resolved')

Searchable as RT126517$

@p6rt
Copy link
Author

p6rt commented Oct 31, 2015

From @coke

This dies, but only on the JVM​:

13​:41 < [Coke]> r​: sub foo($a) { sub bar {} }; my $a=foo(1);
13​:41 <+camelia> rakudo-moar a05867​: ( no output )
13​:41 <+camelia> ..rakudo-jvm a05867​: OUTPUT«java.lang.NullPointerException␤
  in block <unit> at /tmp/tmpfile​:1␤␤»

It's required for (at least) several tests in S02-magicals/sub.t

Also​:

13​:42 < lizmat> [Coke]​: that is a known issue, several places in the core work
  around that
13​:42 < lizmat> r​: sub foo($a) { my $ = sub bar {} }; my $a=foo(1);
13​:42 <+camelia> rakudo-{moar,jvm} a05867​: ( no output )

--
Will "Coke" Coleda

@p6rt
Copy link
Author

p6rt commented Oct 6, 2016

From @usev6

On Sat Oct 31 10​:56​:36 2015, coke wrote​:

This dies, but only on the JVM​:

13​:41 < [Coke]> r​: sub foo($a) { sub bar {} }; my $a=foo(1);
13​:41 <+camelia> rakudo-moar a05867​: ( no output )
13​:41 <+camelia> ..rakudo-jvm a05867​:
OUTPUT«java.lang.NullPointerException␤
in block <unit> at /tmp/tmpfile​:1␤␤»

It's required for (at least) several tests in S02-magicals/sub.t

This was fixed with Raku/nqp@2d88d98201. The tests in S02-magicals/sub.t are passing (again).

Also​:

13​:42 < lizmat> [Coke]​: that is a known issue, several places in the
core work
around that
13​:42 < lizmat> r​: sub foo($a) { my $ = sub bar {} }; my $a=foo(1);
13​:42 <+camelia> rakudo-{moar,jvm} a05867​: ( no output )

@​lizmat​: Are you able to point out those places in the core, perchance? Maybe some workarounds could be removed now?

--
Christian

1 similar comment
@p6rt
Copy link
Author

p6rt commented Oct 6, 2016

From @usev6

On Sat Oct 31 10​:56​:36 2015, coke wrote​:

This dies, but only on the JVM​:

13​:41 < [Coke]> r​: sub foo($a) { sub bar {} }; my $a=foo(1);
13​:41 <+camelia> rakudo-moar a05867​: ( no output )
13​:41 <+camelia> ..rakudo-jvm a05867​:
OUTPUT«java.lang.NullPointerException␤
in block <unit> at /tmp/tmpfile​:1␤␤»

It's required for (at least) several tests in S02-magicals/sub.t

This was fixed with Raku/nqp@2d88d98201. The tests in S02-magicals/sub.t are passing (again).

Also​:

13​:42 < lizmat> [Coke]​: that is a known issue, several places in the
core work
around that
13​:42 < lizmat> r​: sub foo($a) { my $ = sub bar {} }; my $a=foo(1);
13​:42 <+camelia> rakudo-{moar,jvm} a05867​: ( no output )

@​lizmat​: Are you able to point out those places in the core, perchance? Maybe some workarounds could be removed now?

--
Christian

@p6rt
Copy link
Author

p6rt commented Oct 6, 2016

@usev6 - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Oct 6, 2016

From @lizmat

Christian,

On 06 Oct 2016, at 22​:23, Christian Bartolomaeus via RT <bugs-comment@​bugs6.perl.org> wrote​:

13​:42 < lizmat> [Coke]​: that is a known issue, several places in the
core work
around that
13​:42 < lizmat> r​: sub foo($a) { my $ = sub bar {} }; my $a=foo(1);
13​:42 <+camelia> rakudo-{moar,jvm} a05867​: ( no output )

@​lizmat​: Are you able to point out those places in the core, perchance? Maybe some workarounds could be removed now?

src/core/metaops.pm

METAOP_REDUCE_LEFT
METAOP_REDUCE_RIGHT
METAOP_REDUCE_LIST
METAOP_REDUCE_LISTINFIX
METAOP_REDUCE_CHAIN

Liz

@p6rt
Copy link
Author

p6rt commented Oct 7, 2016

From @usev6

On Thu Oct 06 16​:07​:15 2016, elizabeth wrote​:

[...]

13​:42 < lizmat> [Coke]​: that is a known issue, several places in the
core work
around that
13​:42 < lizmat> r​: sub foo($a) { my $ = sub bar {} }; my $a=foo(1);
13​:42 <+camelia> rakudo-{moar,jvm} a05867​: ( no output )

@​lizmat​: Are you able to point out those places in the core,
perchance? Maybe some workarounds could be removed now?

src/core/metaops.pm

METAOP_REDUCE_LEFT
METAOP_REDUCE_RIGHT
METAOP_REDUCE_LIST
METAOP_REDUCE_LISTINFIX
METAOP_REDUCE_CHAIN

Thanks, Liz!

Indeed, it looks like those workarounds are no longer needed. I had a clean spectest on JVM after cleaning up src/core/metaops.pm and opened a pull request​: rakudo/rakudo#898

I'm closing this ticket as resolved.

--
Christian

@p6rt
Copy link
Author

p6rt commented Oct 7, 2016

@usev6 - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Oct 7, 2016
@p6rt p6rt added the JVM Related to Rakudo-JVM label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
JVM Related to Rakudo-JVM
Projects
None yet
Development

No branches or pull requests

1 participant