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

Number of reported actual parameters sent in to an assuming-derived method is always 0 in Rakudo #2146

Closed
p6rt opened this issue Sep 9, 2010 · 5 comments

Comments

@p6rt
Copy link

p6rt commented Sep 9, 2010

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

Searchable as RT77744$

@p6rt
Copy link
Author

p6rt commented Sep 9, 2010

From @masak

<masak> rakudo​: sub f($x, $y) { say $x }; my &g = &f.assuming(5); g
<p6eval> rakudo 859f2d​: OUTPUT«Not enough positional parameters
passed; got 1 but expected 2␤ in 'f' [...]
<masak> ok, one could argue that the numbers should be 0 and 1,
respectively, and that the function should be g.
<masak> but fair enough, not necessarily a bug.
<masak> this, however​:
<masak> rakudo​: class A { our method f($x​: $y) { say $x } }; my $a =
A.new; my &g = &A​::f.assuming( x => $a ); g
<p6eval> rakudo 859f2d​: OUTPUT«Not enough positional parameters
passed; got 0 but expected 2␤ in 'A​::f' [...]
* masak submits rakudobug
<masak> I never have liked, and probably never will like the fact that
the invocant is counted among the positional parameters. but I'm
willing to write that off as a hard-to-fix Parrot idiosyncracy.
<masak> but the 0 there is wrong. we are passing in one of the two arguments.
<masak> can't have it both ways :)
<masak> rakudo​: class A { our method f($x​: $y, $z) { say $x } }; my $a
= A.new; my &g = &A​::f.assuming( y => 42, z => 5 ); g
<p6eval> rakudo 859f2d​: OUTPUT«Not enough positional parameters
passed; got 0 but expected 3␤ in 'A​::f' [...]
<masak> seems it always gives 0.

@p6rt
Copy link
Author

p6rt commented Oct 6, 2010

From @colomon

rakudo​: sub a($a, $b, $c) { say "boo!" }; my &b = &a.assuming(1); say
&a.arity; say &b.arity
p6eval​: rakudo 2ee5db​: OUTPUT«3␤0␤»

As far as I know, the 0 there should be 2.

--
Solomon Foster​: colomon@​gmail.com
HarmonyWare, Inc​: http://www.harmonyware.com

@p6rt
Copy link
Author

p6rt commented Jul 8, 2015

From @usev6

This works now (skids++). I added tests to S06-signature/arity.t with commits Raku/roast@08b64b732a and Raku/roast@1c8e5abec0

I'm closing this ticket as 'resolved'.

1 similar comment
@p6rt
Copy link
Author

p6rt commented Jul 8, 2015

From @usev6

This works now (skids++). I added tests to S06-signature/arity.t with commits Raku/roast@08b64b732a and Raku/roast@1c8e5abec0

I'm closing this ticket as 'resolved'.

@p6rt
Copy link
Author

p6rt commented Jul 8, 2015

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