[ https://issues.apache.org/jira/browse/GROOVY-7436?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14565498#comment-14565498 ]
Thornton Chamberlain commented on GROOVY-7436: ---------------------------------------------- This problem can be avoided by using @SelfType instead of implements. I still think it should work as I described above, but I've changed this from a bug to an improvement. > Multiple inheritance of traits - conflict resolution > ---------------------------------------------------- > > Key: GROOVY-7436 > URL: https://issues.apache.org/jira/browse/GROOVY-7436 > Project: Groovy > Issue Type: Improvement > Reporter: Thornton Chamberlain > Labels: usertask > > {noformat} > trait A { > String exec() {'A'} > } > trait B implements A { > String exec() {'B'} > } > trait C implements A { > } > class X implements A, B, C {} > def x = new X() > assert x.exec() == 'B' > {noformat} > An equivalent example in Scala will use the exec() implementation from B, as > asserted. Groovy will take the implementation from the last declared trait, > C, which inherits the implementation from A but does not define its own > implementation. I think Groovy should use the implementation from the last > declared trait that defines its own implementation. -- This message was sent by Atlassian JIRA (v6.3.4#6332)