[ 
https://issues.apache.org/jira/browse/GROOVY-7522?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14639689#comment-14639689
 ] 

Keegan Witt commented on GROOVY-7522:
-------------------------------------

In theory, this could break someone's existing code if they were relying on the 
overwriting happening.  This could be avoided by adding a Boolean to control 
this behavior.

> TupleConstructor shouldn't overwrite existing constructors
> ----------------------------------------------------------
>
>                 Key: GROOVY-7522
>                 URL: https://issues.apache.org/jira/browse/GROOVY-7522
>             Project: Groovy
>          Issue Type: Bug
>            Reporter: Keegan Witt
>
> {{@TupleConstructor}} should not overwrite existing constructors.  For 
> example, this should work, but doesn't currently
> {code:java}
> assert new Cat("Mr. Bigglesworth").name == null  // fails
> @groovy.transform.TupleConstructor
> class Cat {
>   String name
>   int age
>   Cat(String name) {}
> }
> {code}
> Why aren't the {{includes}}/{{excludes}} annotation elements a sufficient 
> workaround?  Because one might want all the other combinations 
> {{@TupleConstructor}} provides, but still have their own implementation for a 
> subset of the combinations.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to