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

Role composition failure: erroneous method conflict #611

Closed
p6rt opened this issue Jan 11, 2009 · 5 comments
Closed

Role composition failure: erroneous method conflict #611

p6rt opened this issue Jan 11, 2009 · 5 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Jan 11, 2009

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

Searchable as RT62200$

@p6rt
Copy link
Author

p6rt commented Jan 11, 2009

From @mathw

Put this code through Rakudo​:

use v6;

role TestRole {
  method foo() { ... }
}

class TestClass does TestRole {
  method foo() { say "render"; }
}

my TestClass $t .= new();

Rakudo complains that the role composition causes a method conflict
because of 'foo', but TestClass​::foo should be overriding TestRole​::foo.
jnthn speculates on IRC that it's a result of some refactoring in rvar,
where some code got removed and not put back.

19​:57 * jnthn suspects that (a) some code was pulled out in rvar and
not re-instanted and (b) we didn't have a test for this so it went
unnoticed.
19​:57 <@​jnthn> rvar removed a bunch of stuff to make refactoring easier
and then added it back in.
19​:57 <@​jnthn> I think I know exactly what we've lost.

@p6rt
Copy link
Author

p6rt commented Jan 11, 2009

From @moritz

On Sun Jan 11 12​:02​:21 2009, matt-w wrote​:

Put this code through Rakudo​:

use v6;

role TestRole {
method foo() { ... }
}

class TestClass does TestRole {
method foo() { say "render"; }
}

my TestClass $t .= new();

matt-w also added that as a test case to t/spec/S12-roles/composition.t.

Cheers,
Moritz

@p6rt
Copy link
Author

p6rt commented Jan 11, 2009

The RT System itself - Status changed from 'new' to 'open'

@p6rt
Copy link
Author

p6rt commented Jan 12, 2009

From @jnthn

On Sun Jan 11 14​:06​:52 2009, moritz wrote​:

On Sun Jan 11 12​:02​:21 2009, matt-w wrote​:

Put this code through Rakudo​:

use v6;

role TestRole {
method foo() { ... }
}

class TestClass does TestRole {
method foo() { say "render"; }
}

my TestClass $t .= new();

matt-w also added that as a test case to t/spec/S12-roles/composition.t.

Fixed in r35443, and moritz++ unfudged the test.

Thanks!

Jonathan

@p6rt
Copy link
Author

p6rt commented Jan 12, 2009

@jnthn - Status changed from 'open' to 'resolved'

@p6rt p6rt closed this as completed Jan 12, 2009
@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant