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

?? !! report LTA confusion when listop gobbles the !! in Rakudo #3574

Closed
p6rt opened this issue Nov 3, 2014 · 4 comments
Closed

?? !! report LTA confusion when listop gobbles the !! in Rakudo #3574

p6rt opened this issue Nov 3, 2014 · 4 comments

Comments

@p6rt
Copy link

p6rt commented Nov 3, 2014

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

Searchable as RT123115$

@p6rt
Copy link
Author

p6rt commented Nov 3, 2014

From @masak

<masak> m​: sub foo { 2 }; say 1 ?? foo !! 3
<camelia> rakudo-moar 315ec6​: OUTPUT«===SORRY!===␤Found ?? but no !! [...]
<masak> that's an LTA error message (even knowing what's going on there)
<masak> std​: sub foo { 2 }; say 1 ?? foo !! 3
<camelia> std 14ad63b​: OUTPUT«===SORRY!===␤Found ?? but no !! [...]
<masak> and STD.pm6 is no better. hm.
<masak> I ran into it in code like this​:
<masak> m​: module M { enum A is export <B C> }; import M; say 1 ?? B !! C
* masak submits ?? !! LTA rakudobug

Ideally, I would like to see an error message that acknowledges that a
'!!' is actually there, but that it was gobbled by the listop -- much
like this error message warns about a listop gobbling a block​:

<masak> m​: for lines { .say }
<camelia> rakudo-moar 315ec6​: OUTPUT«===SORRY!===␤Function lines needs
parens to avoid gobbling block [...]

@p6rt
Copy link
Author

p6rt commented Mar 31, 2015

From @usev6

This fails now with a typed exception and a fitting error message​:

$ perl6 -e 'sub foo { 2 }; say 1 ?? foo !! 3'
===SORRY!=== Error while compiling -e
Your !! was gobbled by the expression in the middle; please parenthesize
at -e​:1
------> sub foo { 2 }; say 1 ?? foo !!⏏ 3
  expecting any of​:
  infix
  infix stopper
  postfix

I added a test for the typed exception to S03-operators/ternary.t. I'm closing this ticket as 'resolved'.

1 similar comment
@p6rt
Copy link
Author

p6rt commented Mar 31, 2015

From @usev6

This fails now with a typed exception and a fitting error message​:

$ perl6 -e 'sub foo { 2 }; say 1 ?? foo !! 3'
===SORRY!=== Error while compiling -e
Your !! was gobbled by the expression in the middle; please parenthesize
at -e​:1
------> sub foo { 2 }; say 1 ?? foo !!⏏ 3
  expecting any of​:
  infix
  infix stopper
  postfix

I added a test for the typed exception to S03-operators/ternary.t. I'm closing this ticket as 'resolved'.

@p6rt p6rt closed this as completed Mar 31, 2015
@p6rt
Copy link
Author

p6rt commented Mar 31, 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
Projects
None yet
Development

No branches or pull requests

1 participant