Skip Menu |
Report information
Id: 123660
Status: resolved
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: elizabeth <liz [at] dijkmat.nl>
Cc:
AdminCc:

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



From: Elizabeth Mattijsen <liz [...] dijkmat.nl>
To: rakudobug [...] perl.org
Date: Fri, 23 Jan 2015 11:20:52 +0100
Subject: Confusion when using $_ as default
Download (untitled) / with headers
text/plain 690b
[11:17:08] <jnthn> And here's a nice bug: [11:17:10] <lizmat> m: sub a($a = CALLER::CALLER::<$_>) { say $a }; $_ = "foo"; a # indeed [11:17:10] <+camelia> rakudo-moar cd87c4: OUTPUT«foo␤» [11:17:14] <jnthn> m: sub foo($a = CALLER::CALLER::<$_>) { say $a }; given 42 { foo(1); foo() } [11:17:14] <+camelia> rakudo-moar cd87c4: OUTPUT«1␤No such method 'dynamic' for invocant of type 'Int'␤ in method at_key at src/gen/m-CORE.setting:11131␤ in sub postcircumfix:<{ }> at src/gen/m-CORE.setting:3090␤ in sub foo at /tmp/MgALuGqWgZ:1␤ in block <unit> at /tmp/MgALuGqWgZ:1␤␤» [11:18:09] <lizmat> hehe [11:18:17] <lizmat> rakudobuggable ? [11:18:20] <jnthn> Yeah
RT-Send-CC: perl6-compiler [...] perl.org
Download (untitled) / with headers
text/plain 457b
$ perl6-m -e 'sub a($a = CALLER::CALLER::<$_>) { say $a }; $_ = "foo"; a' foo $ perl6-m -e 'sub foo($a = CALLER::CALLER::<$_>) { say $a }; given 42 { foo(1); foo() }' 1 42 The ticket number is mentioned in S06-signature/caller-param.t. The following comment was added with commit 66a1ea8cb1: # These tests all work when using CALLER::CALLER but we should # not need to do that. Minus that fact, 123660 has actually been # fixed since it was reported.
RT-Send-CC: perl6-compiler [...] perl.org
Download (untitled) / with headers
text/plain 641b
On Mon Sep 14 13:04:25 2015, bartolin@gmx.de wrote: Show quoted text
> $ perl6-m -e 'sub a($a = CALLER::CALLER::<$_>) { say $a }; $_ = "foo"; > a' > foo > > $ perl6-m -e 'sub foo($a = CALLER::CALLER::<$_>) { say $a }; given 42 > { foo(1); foo() }' > 1 > 42 > > The ticket number is mentioned in S06-signature/caller-param.t. The > following comment was added with commit 66a1ea8cb1: > > # These tests all work when using CALLER::CALLER but we should > # not need to do that. Minus that fact, 123660 has actually been > # fixed since it was reported.
Ok. given that the original examples pass, and there are tests, closing ticket. -- Will "Coke" Coleda


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