Skip to content

@var parameters do not check for Positional #50

masak opened this Issue Sep 13, 2011 · 1 comment

2 participants

masak commented Sep 13, 2011
<masak> perl6: sub foo(:@a) { say @a[0]; say "alive" }; foo(:a["bar"])
<p6eval> pugs, rakudo d97997, niecza v9-23-g1a8efca: OUTPUT«bar␤alive␤»
<masak> perl6: sub foo(:@a) { say @a[0]; say "alive" }; foo(:a("bar"))
<p6eval> rakudo d97997: OUTPUT«Nominal type check failed for parameter '@a';
               expected Positional but got Str instead␤  in sub foo  [...]
<p6eval> ..niecza v9-23-g1a8efca: OUTPUT«(timeout)»
<p6eval> ..pugs: OUTPUT«bar␤alive␤»
<masak> sorear: ^^
* masak submits nieczabug

There are two problems here: the timeout due to an infinite loop in the vicinity of @a[0], and the fact that the parameter is accepted at all -- I think it should typefail like Rakudo does.

sorear commented Sep 14, 2011

The major bug is now fixed. Typechecking is still needed though, which probably requires better role handling.

@sorear sorear closed this in c8eeefc Jan 5, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.