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

Owner: Nobody
Requestors: alex.jakimenko [at] gmail.com
jns+bc [at] gellyfish.co.uk
Cc:
AdminCc:

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



Subject: [LTA] confusing error with single '{' in double quoted string:
Download (untitled) / with headers
text/plain 703b
perl6 -e 'my $a = "jsjsjs {"; for <a b> -> $b { say $b }' ===SORRY!=== Error while compiling -e Variable '$b' is not declared at -e:1 ------> my $a = "jsjsjs {"; for <a b> -> ⏏$b { say $b } Obviously it is fine if the '{' is backslashed. Similarly: <ilmari> m: my $a = "{ 42"; for <a b> -> $b { say $b } # also LTA error <camelia> rakudo-moar 65bfb6: OUTPUT«===SORRY!=== Error while compiling /tmp/m116oiicso␤Two terms in a row␤at /tmp/m116oiicso:1␤------> my $a = "{ 42⏏"; for <a b> -> $b { say $b } # also LTA␤ expecting any of:␤ infix␤ infix stopper␤ stateme…» This is perl6 version 2015.10-169-gfd3927d built on MoarVM version 2015.10-51-ga362d21
Subject: [LTA] Mention context when suspecting runaway quotes (say "foo'; my $x = 42;)
Download (untitled) / with headers
text/plain 636b
Code: say "foo'; my $x = 42; Result: ===SORRY!=== Error while compiling -e Variable '$x' is not declared at -e:2 ------> my ⏏$x = 42; The error message is of course very confusing. I think that any “not declared” error message that happen within interpolating quotes should say something like: Variable '$x' is not declared (in double quotes started at line 1) I think this would give enough clues to figure out the actual problem. Related, but different ticket: https://rt.perl.org/Ticket/Display.html?id=130261 See also this discussion on perl6.users: https://www.nntp.perl.org/group/perl.perl6.users/2017/09/msg4348.html
Oh. That's actually related to this ticket: https://rt.perl.org/Ticket/Display.html?id=132168

I'll merge it because both tickets are asking for the same problem to be resolved.

On 2015-11-09 05:03:59, jns+bc@gellyfish.co.uk wrote:
Show quoted text
> perl6 -e 'my $a = "jsjsjs {"; for <a b> -> $b { say $b }'
> ===SORRY!=== Error while compiling -e
> Variable '$b' is not declared
> at -e:1
> ------> my $a = "jsjsjs {"; for <a b> -> ⏏$b { say $b }
>
> Obviously it is fine if the '{' is backslashed.
>
> Similarly:
>
> <ilmari> m: my $a = "{ 42"; for <a b> -> $b { say $b } # also LTA
> error
> <camelia> rakudo-moar 65bfb6: OUTPUT«===SORRY!=== Error while
> compiling /tmp/m116oiicso␤Two terms in a row␤at
> /tmp/m116oiicso:1␤------> my $a = "{ 42⏏"; for <a b> -> $b { say $b }
> # also LTA␤ expecting any of:␤ infix␤ infix stopper␤
> stateme…»
>
>
> This is perl6 version 2015.10-169-gfd3927d built on MoarVM version
> 2015.10-51-ga362d21




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

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