[ 
https://issues.apache.org/jira/browse/GROOVY-11339?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Eric Milles reassigned GROOVY-11339:
------------------------------------

    Assignee: Eric Milles

> 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
>            Assignee: Eric Milles
>            Priority: Major
>
> 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)

Reply via email to