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

perl6 -e "(6;)" results in "===SORRY!===\nCannot find method 'returns'" #3660

Closed
p6rt opened this issue Jan 29, 2015 · 5 comments
Closed

perl6 -e "(6;)" results in "===SORRY!===\nCannot find method 'returns'" #3660

p6rt opened this issue Jan 29, 2015 · 5 comments

Comments

@p6rt
Copy link

p6rt commented Jan 29, 2015

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

Searchable as RT123696$

@p6rt
Copy link
Author

p6rt commented Jan 29, 2015

From @raiph

say (5; 6,5; 5.6; 6,; 5,6; 3+3; 6\ ; 66; :4foo); # OK
say (5; 6,5; 5.6; 6,; 5,6; 3+3; 6\ ; 66; :4foo, 6;); # boom

04​:29 raiph m​: say (6;)
04​:29 camelia rakudo-moar 166cd3​: OUTPUT«===SORRY!===␤Cannot find method
'flat'␤»
04​:30 raiph m​: say [6;]
04​:30 camelia rakudo-moar 166cd3​: OUTPUT«===SORRY!===␤Cannot find method
'flat'␤»
04​:30 raiph m​: say (6 ;)
04​:30 camelia rakudo-moar 166cd3​: OUTPUT«6␤»
04​:30 raiph m​: say (6\ ;)
04​:30 camelia rakudo-moar 166cd3​: OUTPUT«6␤»
04​:31 raiph m​: say (66;)
04​:31 camelia rakudo-moar 166cd3​: OUTPUT«66␤»
04​:31 raiph m​: say ( 6;)
04​:31 camelia rakudo-moar 166cd3​: OUTPUT«===SORRY!===␤Cannot find method
'flat'␤»
04​:34 raiph m​: say (2,3,4; 5,6,7; 8,9,0)
04​:34 camelia rakudo-moar 166cd3​: OUTPUT«2 3 4 5 6 7 8 9 0␤»
04​:35 raiph m​: say (2,3,4; 5,6,7; 6; 8,9,0) # add a lone 6; anywhere and
boom
04​:35 camelia rakudo-moar 166cd3​: OUTPUT«===SORRY!===␤Unknown QAST node
type NQPMu␤»
04​:40 m​: (6;) # above bug, golfed, about to rakudobug
04​:40 camelia rakudo-moar 166cd3​: OUTPUT«===SORRY!===␤Cannot find method
'returns'␤»
04​:47 raiph m​: say (2,3,4; 5,6,7; 5,6; 8,9,0) # 5,6; is fine
04​:47 camelia rakudo-moar 166cd3​: OUTPUT«2 3 4 5 6 7 5 6 8 9 0␤»
04​:48 raiph m​: say (2,3,4; 5,6,7; 5+1; 8,9,0) # 5+1; is fine
04​:48 camelia rakudo-moar 166cd3​: OUTPUT«2 3 4 5 6 7 6 8 9 0␤»
04​:51 raiph is borked in my december R too

--
raiph

@p6rt
Copy link
Author

p6rt commented Jan 31, 2015

From @moritz

On Wed Jan 28 21​:28​:11 2015, raiph wrote​:

04​:35 raiph m​: say (2,3,4; 5,6,7; 6; 8,9,0) # add a lone 6; anywhere and
boom
04​:35 camelia rakudo-moar 166cd3​: OUTPUT«===SORRY!===␤Unknown QAST node
type NQPMu␤»
04​:40 m​: (6;) # above bug, golfed, about to rakudobug
04​:40 camelia rakudo-moar 166cd3​: OUTPUT«===SORRY!===␤Cannot find method
'returns'␤»

--target=ast says​:

  - QAST​::Stmts
  - QAST​::WVal(Array)
  - QAST​::Stmts (6;)
  - QAST​::Stmt (6;)
  - QAST​::Stmts 6;
  - (NQPMu)

So it seems the codegen is wrong, and the optimizer blows up on it. It should probably generate a QAST​::VWal (Int) or so.

@p6rt
Copy link
Author

p6rt commented Feb 26, 2015

From @usev6

The problem was that '6;' was parsed as meaning 'no strict'. This lead to some discussion on #perl6 and a change in the design docs (Raku/old-design-docs@b7196bd240) and the Grammar for parsing Perl 6 (rakudo/rakudo@62266f7e20).

Nowadays there is no problem with '(6;)'

$ perl6 -e 'say (6;)'
6

$ perl6 -e 'say (2,3,4; 5,6,7; 6; 8,9,0)'
2 3 4 5 6 7 6 8 9 0

I added a test to S02-names/strict.t with commit Raku/roast@1cd6489a07. I'm closing this ticket as resolved.

1 similar comment
@p6rt
Copy link
Author

p6rt commented Feb 26, 2015

From @usev6

The problem was that '6;' was parsed as meaning 'no strict'. This lead to some discussion on #perl6 and a change in the design docs (Raku/old-design-docs@b7196bd240) and the Grammar for parsing Perl 6 (rakudo/rakudo@62266f7e20).

Nowadays there is no problem with '(6;)'

$ perl6 -e 'say (6;)'
6

$ perl6 -e 'say (2,3,4; 5,6,7; 6; 8,9,0)'
2 3 4 5 6 7 6 8 9 0

I added a test to S02-names/strict.t with commit Raku/roast@1cd6489a07. I'm closing this ticket as resolved.

@p6rt p6rt closed this as completed Feb 26, 2015
@p6rt
Copy link
Author

p6rt commented Feb 26, 2015

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant