codeconsole commented on PR #3048: URL: https://github.com/apache/groovy/pull/3048#issuecomment-6505011558
Fixed in 39b195ca9a. The interfaces of the class itself are now searched too, so `super.first()` reaches the extension method in a class that implements `Iterable`, or that delegates `List` with `@Delegate`. `testSuperDotExtensionMethodOfAnInterfaceOfTheClass` covers both cases and fails without the change. On the ordering nit: candidates are now collected in declaration order, starting with the superclasses (nearest first), then the interfaces of the class and of each superclass, breadth first. They no longer come from `CachedClass.getInterfaces()`, which is a hash set. When two extension methods belong to unrelated types, the first one met wins, as the Javadoc now says. The new test runs only in dynamic mode. Under `@TypeChecked` and `@CompileStatic`, `super.first()` in that class is rejected because the method comes from an interface (GROOVY-8299, GROOVY-10494). The qualified `Iterable.super.first()` is rejected too, with "Abstract method first() cannot be called directly". That also happens in 5.0.8 and 6.0.0, so I've filed it separately as GROOVY-12556. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
