groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GROOVY-7522) Document TupleConstructor overwrites empty default constructors
Date Tue, 28 Jul 2015 13:48:04 GMT

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

ASF GitHub Bot commented on GROOVY-7522:
----------------------------------------

GitHub user paulk-asert opened a pull request:

    https://github.com/apache/incubator-groovy/pull/75

    GROOVY-7522: TupleConstructor overwrites empty default constructors

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/paulk-asert/incubator-groovy groovy7522

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/incubator-groovy/pull/75.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #75
    
----
commit 891aaa2f7f11afc4a62f0501ccae550f23c4ff05
Author: Paul King <paulk@asert.com.au>
Date:   2015-07-28T13:45:14Z

    GROOVY-7522: TupleConstructor overwrites empty default constructors

----


> Document TupleConstructor overwrites empty default constructors
> ---------------------------------------------------------------
>
>                 Key: GROOVY-7522
>                 URL: https://issues.apache.org/jira/browse/GROOVY-7522
>             Project: Groovy
>          Issue Type: Documentation
>            Reporter: Keegan Witt
>
> Document that if you have a default constructor with no content, {{TupleConstructor}}
will overwrite the content.
> ----
> Jira was originally titled _TupleConstructor shouldn't overwrite existing constructors_,
but was re-purposed for the reasons mentioned in the comments.  Original content is below.
> {{@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)

Mime
View raw message