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

default-assignment (//-) doesn't mix with implicit-variable method call in Rakudo #3003

Closed
p6rt opened this issue Dec 22, 2012 · 7 comments
Closed

Comments

@p6rt
Copy link

p6rt commented Dec 22, 2012

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

Searchable as RT116178$

@p6rt
Copy link
Author

p6rt commented Dec 22, 2012

From @masak

<moritz> nr​: my @​a = <a b c>; my %h; %h{.value} //= .key for @​a.pairs
<p6eval> niecza v24-12-g8e50362​: ( no output )
<p6eval> ..rakudo c8de2e​: OUTPUT«Method 'key' not found for invocant
of class 'Any' [...]
<moritz> rakudobug
<moritz> afaict the first one uncovered by this year's p6cc :-)
<masak> moritz++
* masak submits rakudobug
<moritz> r​: $_ = 'abc'; my $x //= .uc; say $x
<p6eval> rakudo c8de2e​: OUTPUT«ABC␤»
<moritz> r​: my $x //= .uc for 'a'
<p6eval> rakudo c8de2e​: OUTPUT«Method 'uc' not found for invocant of
class 'Any' [...]
<moritz> that's the golfed variation

@p6rt
Copy link
Author

p6rt commented Mar 11, 2015

From @usev6

The error messages are gone but still the implicit-variable method calls don't work​:

$ perl6 -e 'my @​a = <a b c>; my %h; %h{.value} //= .key for @​a.pairs; say %h'
a => (Any), b => (Any), c => (Any)

$ perl6 -e 'my $x //= .uc for "a"; say $x'

For this second example I added a test (fudged 'todo') to S03-operators/assign.t with commit Raku/roast@b80e436b3f

When the method is called directly the default-assignment works​:

$ perl6 -e 'my $x //= "a".uc; say $x'
A

1 similar comment
@p6rt
Copy link
Author

p6rt commented Mar 11, 2015

From @usev6

The error messages are gone but still the implicit-variable method calls don't work​:

$ perl6 -e 'my @​a = <a b c>; my %h; %h{.value} //= .key for @​a.pairs; say %h'
a => (Any), b => (Any), c => (Any)

$ perl6 -e 'my $x //= .uc for "a"; say $x'

For this second example I added a test (fudged 'todo') to S03-operators/assign.t with commit Raku/roast@b80e436b3f

When the method is called directly the default-assignment works​:

$ perl6 -e 'my $x //= "a".uc; say $x'
A

@p6rt
Copy link
Author

p6rt commented Mar 11, 2015

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

@p6rt
Copy link
Author

p6rt commented May 8, 2015

From @usev6

This works now. I unfudged the existing test and added a second test to S03-operators/assign.t
with commit Raku/roast@fdaa7dc62e

I'm closing this ticket as 'resolved'.

1 similar comment
@p6rt
Copy link
Author

p6rt commented May 8, 2015

From @usev6

This works now. I unfudged the existing test and added a second test to S03-operators/assign.t
with commit Raku/roast@fdaa7dc62e

I'm closing this ticket as 'resolved'.

@p6rt
Copy link
Author

p6rt commented May 8, 2015

@usev6 - Status changed from 'open' 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