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

Confusion when using $_ as default #3651

Closed
p6rt opened this issue Jan 23, 2015 · 6 comments
Closed

Confusion when using $_ as default #3651

p6rt opened this issue Jan 23, 2015 · 6 comments

Comments

@p6rt
Copy link

p6rt commented Jan 23, 2015

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

Searchable as RT123660$

@p6rt
Copy link
Author

p6rt commented Jan 23, 2015

From @lizmat

[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

@p6rt
Copy link
Author

p6rt commented Sep 14, 2015

From @usev6

$ 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.

1 similar comment
@p6rt
Copy link
Author

p6rt commented Sep 14, 2015

From @usev6

$ 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.

@p6rt
Copy link
Author

p6rt commented Apr 26, 2016

From @coke

On Mon Sep 14 13​:04​:25 2015, bartolin@​gmx.de wrote​:

$ 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

@p6rt
Copy link
Author

p6rt commented Apr 26, 2016

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Apr 26, 2016

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

@p6rt p6rt closed this as completed Apr 26, 2016
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