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

A private method expecting an array and getting an array attribute gives a bogus error message about not enough parameters in Rakudo #2528

Closed
p6rt opened this issue Oct 22, 2011 · 5 comments

Comments

@p6rt
Copy link

p6rt commented Oct 22, 2011

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

Searchable as RT101964$

@p6rt
Copy link
Author

p6rt commented Oct 22, 2011

From @masak

<im2ee> I have a problem​:
<im2ee> has @​!connections is rw;
<im2ee> self!check(@​!connections);
<im2ee> method !check(@​readers is rw) {
<im2ee> got​:
<im2ee> Not enough positional parameters passed; got 1 but expected 2
<masak> nom​: class A { has @​!c is rw; method foo { self!bar(@​!c) };
method !bar(@​r is rw) { say "OH HAI" } }; A.new.foo
<p6eval> nom 142c41​: OUTPUT«Not enough positional parameters passed;
got 1 but expected 2␤ in method bar at /tmp/5N67J4NTFy​:1␤ in method
dispatch​:<!> at src/gen/CORE.setting​:710␤ in method foo at
/tmp/5N67J4NTFy​:1␤ in block <anon> at /tmp/5N67J4NTFy​:1␤ in <anon>
at /tmp/5N67J4NTFy​:1␤»…
<masak> im2ee​: confirmed.
<masak> im2ee​: I think that's a bug.
<masak> anyone agree/disagree?
<im2ee> It can be my first rakudobug which i found. :)
<tadzik> it does look wrongy, at the first glance
* masak submits rakudobug
<im2ee> :)

@p6rt
Copy link
Author

p6rt commented Oct 23, 2011

From @jnthn

On Sat Oct 22 05​:51​:00 2011, masak wrote​:

<im2ee> I have a problem​:
<im2ee> has @​!connections is rw;
<im2ee> self!check(@​!connections);
<im2ee> method !check(@​readers is rw) {
<im2ee> got​:
<im2ee> Not enough positional parameters passed; got 1 but expected 2
<masak> nom​: class A { has @​!c is rw; method foo { self!bar(@​!c) };
method !bar(@​r is rw) { say "OH HAI" } }; A.new.foo
<p6eval> nom 142c41​: OUTPUT«Not enough positional parameters passed;
got 1 but expected 2␤ in method bar at /tmp/5N67J4NTFy​:1␤ in method
dispatch​:<!> at src/gen/CORE.setting​:710␤ in method foo at
/tmp/5N67J4NTFy​:1␤ in block <anon> at /tmp/5N67J4NTFy​:1␤ in <anon>
at /tmp/5N67J4NTFy​:1␤»…
<masak> im2ee​: confirmed.
<masak> im2ee​: I think that's a bug.
<masak> anyone agree/disagree?
<im2ee> It can be my first rakudobug which i found. :)
<tadzik> it does look wrongy, at the first glance
* masak submits rakudobug
<im2ee> :)

Fixed.

class A { has @​!c is rw; method foo { self!bar(@​!c) }; method !bar(@​r
is rw) { say "OH HAI" } }; A.new.foo
OH HAI

Test needed.

/jnthn

@p6rt
Copy link
Author

p6rt commented Oct 23, 2011

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

@p6rt
Copy link
Author

p6rt commented Oct 24, 2011

From @moritz

Now tested in S12-methods/private.t.

@p6rt
Copy link
Author

p6rt commented Oct 24, 2011

@moritz - 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