Skip to content
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

Multi methods from separate roles conflict despite where constraint #4927

Closed
p6rt opened this issue Dec 25, 2015 · 5 comments
Closed

Multi methods from separate roles conflict despite where constraint #4927

p6rt opened this issue Dec 25, 2015 · 5 comments

Comments

@p6rt
Copy link

p6rt commented Dec 25, 2015

Migrated from rt.perl.org#127024 (status was 'resolved')

Searchable as RT127024$

@p6rt
Copy link
Author

p6rt commented Dec 25, 2015

From @skids

Regression​:

(09​:41​:06 PM) skids​: m​: role A { multi method a ($ where { $_.say; $_ ~~ /a/ } ) { "A".say }; }; role B { multi method a ($ where { $_.say; $_ ~~ /b/ } ) { "B".say } }; class C does A does B { }; C.new.a("a");
(09​:41​:07 PM) camelia​: rakudo-moar e360bd​: OUTPUT«===SORRY!=== Error while compiling /tmp/dMwEKoUikS␤Multi method 'a' with signature :(C $​: $ where { ... }, *%_) must be resolved by class C because it exists in multiple roles (B, A)␤at /tmp/dMwEKoUikS​:1␤»
(09​:41​:36 PM) skids​: star​: role A { multi method a ($ where { $_.say; $_ ~~ /a/ } ) { "A".say }; }; role B { multi method a ($ where { $_.say; $_ ~~ /b/ } ) { "B".say } }; class C does A does B { }; C.new.a("a");
(09​:41​:37 PM) camelia​: star-m 2015.09​: OUTPUT«a␤a␤a␤A␤»

Where clauses should prevent multi-methods from conflicting.

@p6rt
Copy link
Author

p6rt commented Jan 2, 2016

From @dwarring

$ cat > tst.pl

role R1 {
  multi method foo(42) {}
  multi method foo(69) {}
}

role R2 { }

class C does R1 does R2 {}

$ perl6 --version
This is Rakudo version 2015.12-72-g3ea4dff built on MoarVM version 2015.12
implementing Perl 6.c.
$ perl6 tst.pl
Multi method 'foo' with signature :(C $​: Int $ where { ... }, *%_) must be resolved by class C because it exists in multiple roles (R1, R1)
at /home/jachadley/git/perl6-PDF-DOM/tst.pl​:8

@p6rt
Copy link
Author

p6rt commented Jan 3, 2016

From @skids

I have PR'd a fix in PR#​672. Passes all spectests, and fails no tests not already failing on roast/6.c.

@p6rt
Copy link
Author

p6rt commented Jan 5, 2016

From @skids

On Sun Jan 03 15​:23​:33 2016, bri@​abrij.org wrote​:

I have PR'd a fix in PR#​672. Passes all spectests, and fails no tests
not already failing on roast/6.c.

Patch was merged and spectests are now added in S06-multi/value-based.t.

Closing.

@p6rt p6rt closed this as completed Jan 5, 2016
@p6rt
Copy link
Author

p6rt commented Jan 5, 2016

@skids - Status changed from 'new' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant