# New Ticket Created by
# Please include the string: [perl #122440]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org/Ticket/Display.html?id=122440 >
Hello,
I have the following failure from Rakudo 2014-04 when running some
tests:
ok 4 - LDAP object out of scope should be true.
setData - array uri called, public API. in method setData
at /home/aparker/Documents/LDAP/lib/LDAP.pm6:139
Type check failed in assignment to '@uri'; expected 'Str' but got
'Array'
in method REIFY at gen/parrot/CORE.setting:8667
in method reify at gen/parrot/CORE.setting:7511
in method reify at gen/parrot/CORE.setting:7498
in method reify at gen/parrot/CORE.setting:7596
in method reify at gen/parrot/CORE.setting:7498
in method reify at gen/parrot/CORE.setting:7498
in method gimme at gen/parrot/CORE.setting:7962
in method eager at gen/parrot/CORE.setting:7934
in method join at gen/parrot/CORE.setting:1637
in method perl at gen/parrot/CORE.setting:8754
in method perl at gen/parrot/CORE.setting:1060
in method perl at gen/parrot/CORE.setting:8812
in method perl at gen/parrot/CORE.setting:1060
in method gist at gen/parrot/CORE.setting:9200
in method gist at gen/parrot/CORE.setting:1056
in method setData at /home/aparker/Documents/LDAP/lib/LDAP.pm6:146
in method setData at gen/parrot/CORE.setting:542
in block at 00-ctests.t:57
# Looks like you planned 44 tests, but ran 4
Code in the test data is:
my Str @uri = (
[<ldap://ab21a.abcdf.com:6666/o=University%20of%
20Michigan,c=US??sub?(cn=Babs%20Jensen)>],
[<ldap://ab21a.abcdf.com:6666/o=University%20of%
20Michigan,c=US??sub?(cn=Babs%20Jensen)>],
[<ldap://ab21a.abcdf.com:6666/o=University%20of%
20Michigan,c=US??sub?(cn=Babs%20Jensen)>],
) ;
An array definition with string data (mail client has messed up a little
here).
Call in test data is:
my $errObj1 = $LDAPinstance1.setData( uri => @uri ); (This is line 57 in
the tests.)
System correctly runs the right multi method, which is coded:
multi method setData( Str :@uri!, <==== This 'Str' causes the issue.
Str :$iAm,
IO::Path :$libName = $libNameDefault,
) {
# Debugging!
warn 'setData - array uri called, public API.'
if %*ENV<DEBUG>;
# Create a hash of all possible parameters.
my %params =
iAm => $iAm, libName => $libName, uri => @uri,
;
say %params.gist; <====================== Fails here!
This is line 146.
# Debugging! - list all input data.
if %*ENV<DEBUG> {
my $g = %params.perl;
warn 'setData - array uri %params =' ~ $g ~ '.';
}
# Validate the passed data items.
my $errObj = self!setDataParams( %params );
return $errObj;
}
or is this just my bad code? Removing the "array of strings"
definition removes the problem; but I rather like type
definitions! B-)
Many thanks,
Andrew N Parker