Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
-
None
Description
If the case mentioned in https://docs.groovy-lang.org/latest/html/documentation/#_default_conflict_resolution used static methods instead of instance methods, "T.super.m()" disambiguation is not available.
Consider the following:
trait A { static m() { 'A' } } trait B { static m() { 'B' } } class C implements A, B { void test() { print m() // prints "B" print A.super.m() // java.lang.IllegalArgumentException or some other compiler problem print B.super.m() // java.lang.IllegalArgumentException or some other compiler problem } } new C().test()