Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
Consider the following:
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) { } }
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.