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
problem mixing in role with multi builds #6038
Comments
From @MARTIMMHi, I get the following error using version 2016.08.1-66-g1ff1aae built on Cannot resolve caller BUILD(CC+{RR}: ); none of these signatures match: The code which generates the error (on the line with '$c does RR'); role RR { } class CC { multi submethod BUILD ( Str :$t! ) { } my CC $c .= new(:t<text1>); Removing the last line and add a trait 'does' to the class works but is Greetings, |
From @zoffixznetOn Sat, 28 Jan 2017 16:42:46 -0800, mt1957@gmail.com wrote:
Some observations: 1) All submethods are affected and sticking `Any` or `Mu` into invocant doesn't help (perhaps correctly, because these are *sub*methods?): <Zoffix> m: role RR {}; class Foo { multi submethod foo($x) { $x.say } }; (Foo.new does RR).foo: 42 2) Functionality of multi submethods seems busted. For example here's the multi no match error occurs: <Zoffix> m: class Bar { multi submethod BUILD() {} }; class Foo is Bar {}.new But goes away if we use the second class in the invocant: <Zoffix> m: class Foo {…};class Bar { multi submethod BUILD(Foo:) {} }; class Foo is Bar {}.new 3) The multi build works in this configuration of being in role and class and role being mixed in advance: <Zoffix> m: role RR {multi submethod BUILD(:$x!) {say "role"}}; class Foo does RR { multi submethod BUILD(:$y!) {say "hi"} }; Foo.new: :x As long as invocant marker matches the class the submethod's in: <Zoffix> m: role RR {multi submethod BUILD(:$x!) {say "role"}}; class Foo does RR { multi submethod BUILD($: :$y!) {say "hi"} }; Foo.new: :y 4) Getting this weird error about two unnamed parameters, which happens only when I use `:$` named in class and try to mix in a role that has another multi with some named param. waat: <Zoffix> m: class Foo { multi submethod BUILD(:$) {say "hi"} }; Foo.new |
The RT System itself - Status changed from 'new' to 'open' |
Migrated from rt.perl.org#130663 (status was 'open')
Searchable as RT130663$
The text was updated successfully, but these errors were encountered: