Eric Milles created GROOVY-11323: ------------------------------------ Summary: Interface default method and static import precedence Key: GROOVY-11323 URL: https://issues.apache.org/jira/browse/GROOVY-11323 Project: Groovy Issue Type: Bug Reporter: Eric Milles Assignee: Eric Milles
Consider the following: {code:groovy} import static Bar.* interface Foo { default m() { 'Foo' } } class Bar { static m() { 'Bar' } } class Baz implements Foo { void test() { assert m() == 'Foo' } } new Baz().test() {code} The implicit-this method call "m()" has two possible sources. Since {{Foo}} is a super-interface, it should be the one selected. However, {{StaticImportVisitor}} does not detect that option and replaces the method call with "Bar.m()". -- This message was sent by Atlassian Jira (v8.20.10#820010)