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

Declaring a sub in a given block causes a silly error in Rakudo #2210

Closed
p6rt opened this issue Oct 5, 2010 · 5 comments
Closed

Declaring a sub in a given block causes a silly error in Rakudo #2210

p6rt opened this issue Oct 5, 2010 · 5 comments

Comments

@p6rt
Copy link

p6rt commented Oct 5, 2010

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

Searchable as RT78234$

@p6rt
Copy link
Author

p6rt commented Oct 5, 2010

From @masak

<masak> rakudo​: given $_ { sub foo($text) { $text }; say foo($_) }
<p6eval> rakudo 2ee5db​: OUTPUT«Too many positional parameters passed;
got 1 but expected 0 [...]
<jnthn> masak​: Something looks rotten there.
<masak> rakudo​: sub foo($text) { $text }; given $_ { foo($_) }
<p6eval> rakudo 2ee5db​: ( no output )
<masak> rakudo​: sub foo($text) { $text }; given $_ { say foo($_) }
<p6eval> rakudo 2ee5db​: OUTPUT«Any()␤»
<jnthn> oh
<jnthn> leaky contextual?
<masak> jnthn​: no idea.
<jnthn> Feels lajk.
* masak submits rakudobug
<jnthn> masak++
<masak> rakudo​: given $_ { sub foo($text) { $text }; say foo() }
<p6eval> rakudo 2ee5db​: OUTPUT«Too many positional parameters passed;
got 1 ut expected 0 [...]
<masak> there's just no way to please this error.

@p6rt
Copy link
Author

p6rt commented Mar 5, 2011

From @masak

On Tue Oct 05 15​:38​:33 2010, masak wrote​:

<masak> rakudo​: given $_ { sub foo($text) { $text }; say foo($_) }
<p6eval> rakudo 2ee5db​: OUTPUT«Too many positional parameters passed;
got 1 but expected 0 [...]
<jnthn> masak​: Something looks rotten there.
<masak> rakudo​: sub foo($text) { $text }; given $_ { foo($_) }
<p6eval> rakudo 2ee5db​: ( no output )
<masak> rakudo​: sub foo($text) { $text }; given $_ { say foo($_) }
<p6eval> rakudo 2ee5db​: OUTPUT«Any()␤»
<jnthn> oh
<jnthn> leaky contextual?
<masak> jnthn​: no idea.
<jnthn> Feels lajk.
* masak submits rakudobug
<jnthn> masak++
<masak> rakudo​: given $_ { sub foo($text) { $text }; say foo() }
<p6eval> rakudo 2ee5db​: OUTPUT«Too many positional parameters passed;
got 1 ut expected 0 [...]
<masak> there's just no way to please this error.

The above analysis is a little bit off. After rediscovering the bug, this is
the golfing of it that I got​:

$ perl6 -e 'given 0 { sub a {} }'
Too many positional parameters passed; got 1 but expected 0
  in main program body at line 1

@p6rt
Copy link
Author

p6rt commented Mar 5, 2011

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

@p6rt
Copy link
Author

p6rt commented Oct 26, 2011

From @moritz

works now, and tested in given.t

@p6rt
Copy link
Author

p6rt commented Oct 26, 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