Skip Menu |
Report information
Id: 131413
Status: new
Priority: 0/
Queue: perl6

Owner: Nobody
Requestors: cpan [at] zoffix.com
Cc:
AdminCc:

Severity: (no value)
Tag: (no value)
Platform: (no value)
Patch Status: (no value)
VM: (no value)



Subject: [LTA] Errors in Int() coercer
Download (untitled) / with headers
text/plain 816b
The first one says it expected Int but got Str, when in reality the type constraint is Any-to-Int:D coercer. The second one talks about Int methods, but I ain't calling any. IMO the coercer should catch such errors when calling the method and report them as type check failure instead. 18:34 Zoffix m: sub (Int:D()) {}( Str ) 18:34 camelia rakudo-moar fb7dd8: OUTPUT: «Type check failed in binding to parameter '<anon>'; expected Int but got Str (Str)␤ in sub at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤» 18:34 Zoffix m: sub (Int()) {}( Str ) 18:34 camelia rakudo-moar fb7dd8: OUTPUT: «Invocant of method 'Int' must be an object instance of type 'Str', not a type object of type 'Str'. Did you forget a '.new'?␤ in sub at <tmp> line 1␤ in block <unit> at <tmp> line 1␤␤»


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org