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

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

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



Subject: [BUG] `only` methods are used where `multies` should be, preventing dispatch to Mu.* candidates
Download (untitled) / with headers
text/plain 868b
Some types provide methods, like .Bool, .elems, .Str that are defined for :D subtypes. However, these methods are defined as `only` methods, not `multi`, so the dispatch for :U subtypes fails, instead of those be handled by Mu.* methods. I already fixed[^1] a bunch for Baggy role, but I notice other types have similar issue: <Zoffix> m: Seq.Bool <camelia> rakudo-moar dd4dfb: OUTPUT: «Invocant requires an instance of type Seq, but a type object was passed. Did you forget a .new?␤ in block <unit> at <tmp> line 1␤␤» We need to check the codebase for more of these. I think some construct similar to `for Any.^methods(:all)».name -> $name { for @all-core-types { ."$name"() }}` can be used for automated finding of methods that need to be changed to multies. [1] https://github.com/rakudo/rakudo/commit/e8af8553eae9abfe4f5cd02dcf4114c5c4877c51
RT-Send-CC: perl6-compiler [...] perl.org
Download (untitled) / with headers
text/plain 139b
Download (untitled) / with headers
text/plain 135b
Seq.Int, Seq.Numeric, Seq.elems are another bunch. We need some programmatically-assisted way to audit the entire codebase for these.


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