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

Jochen Theodorou commented on GROOVY-7600:
------------------------------------------

I take out of this discussion so far, that we miss a way to express "immutable 
if the generics parameters are immutable". It is a difference to the 
black/white look @Immutable currently has. And Optional is not the only case to 
consider here. I think the same goes for a field of type List. In that case we 
use a cloned unmodifiable List, but what is it worth, if the list elements are 
still mutable?

> @Immutable support for Optional?
> --------------------------------
>
>                 Key: GROOVY-7600
>                 URL: https://issues.apache.org/jira/browse/GROOVY-7600
>             Project: Groovy
>          Issue Type: Improvement
>    Affects Versions: 2.4.4
>            Reporter: Christopher Smith
>
> The {{@Immutable}} transform does not have any particular understanding of 
> {{java.util.Optional}}. The holder class itself is immutable, but the logical 
> immutability depends on the contained type. It would be helpful for 
> {{@Immutable}} to understand such holder types and do its sanity check on the 
> generic type.



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

Reply via email to