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
perl6-p fails using @array.gist on array defined as a named parameter to a method #3466
Comments
From andynparker@googlemail.comHello, I have the following failure from Rakudo 2014-04 when running some ok 4 - LDAP object out of scope should be true. setData - array uri called, public API. in method setData Type check failed in assignment to '@uri'; expected 'Str' but got # Looks like you planned 44 tests, but ran 4 Code in the test data is: my Str @uri = ( An array definition with string data (mail client has messed up a little Call in test data is: System correctly runs the right multi method, which is coded: multi method setData( Str :@uri!, <==== This 'Str' causes the issue. or is this just my bad code? Removing the "array of strings" Many thanks, Andrew N Parker |
From @usev6On Wed Jul 30 07:33:05 2014, andynparker@googlemail.com wrote:
Hi, it's been quite a while since you opened this bug report. Nonetheless, today I tried to reproduce the problem you described. It looks to me as if the assignment to @uri (your test data) is to blame for the error you see. I'll shorten the ldap uris to demonstrate: $ perl6 -e 'my @uri = ( [<ldap1>], [<ldap2>]); say @uri.perl; say @uri[0].WHAT; say @uri[0].perl; say @uri[0][0].WHAT; say @uri[0][0].perl' So this is not an Array of Str, but an Array of Array. If you remove the square brackets from your test data, you really get an Array of Str: $ perl6 -e 'my @uri = ( <ldap1>, <ldap2>); say @uri.perl; say @uri[0].WHAT; say @uri[0].perl;' With that data IMHO you shouldn't get the error message you encountered. The underlying problem seems to be a bug in Rakudo: The assignment to @uri with a type constraint should result in an exception X::TypeCheck::Assignment if the type doesn't match. That indeed happens, when you call your assignment on its own: $ perl6 -e 'my Str @uri = ( [<ldap1>], [<ldap2>])' But -- and that's the bug -- when the assignment is followed by some other code, this doesn't blow up. That's what seems to happen in your program. (It blows up later when you use your method 'setData'. $ perl6 -e 'my Str @uri = ( [<ldap1>], [<ldap2>]); say "alive"' I'm going to open a separate bug report for this assignment not blowing up. Best regards Christian |
The RT System itself - Status changed from 'new' to 'open' |
From @usev6The underlying bug in Rakudo I spoke about is now fixed (in the 'glr' branch). There is a test in roast -- cmp. Ticket 124079 (https://rt-archive.perl.org/perl6/Ticket/Display.html?id=124079). The shortened code from the bug report dies as expected: $ perl6 -e 'my Str @uri = ([<ldap1>], [<ldap2>]); say "alive"' I'm closing this ticket as 'resolved'. |
1 similar comment
From @usev6The underlying bug in Rakudo I spoke about is now fixed (in the 'glr' branch). There is a test in roast -- cmp. Ticket 124079 (https://rt-archive.perl.org/perl6/Ticket/Display.html?id=124079). The shortened code from the bug report dies as expected: $ perl6 -e 'my Str @uri = ([<ldap1>], [<ldap2>]); say "alive"' I'm closing this ticket as 'resolved'. |
@usev6 - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#122440 (status was 'resolved')
Searchable as RT122440$
The text was updated successfully, but these errors were encountered: