Eric Milles created GROOVY-11339:
------------------------------------
Summary: AutoImplement and method with default arguments
Key: GROOVY-11339
URL: https://issues.apache.org/jira/browse/GROOVY-11339
Project: Groovy
Issue Type: Bug
Reporter: Eric Milles
Consider the following:
{code:groovy}
interface I {
def foo(bar)
def foo(bar,baz)
// ...
}
@groovy.transform.AutoImplement
class C implements I {
@Override // foo(bar) and foo(bar,baz)
def foo(bar, baz = null) {
}
}
{code}
We want to auto-implement most of {{I}} but explicitly provide an
implementation for both {{foo}} methods. Compiler says "The method with
default parameters "java.lang.Object foo(java.lang.Object, java.lang.Object)"
defines a method "java.lang.Object foo(java.lang.Object)" that
is already defined."
Defining the overrides separately (no default generated method) works fine.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)