You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (Jira)" <ji...@apache.org> on 2021/10/11 01:06:00 UTC
[jira] [Updated] (GROOVY-10293) STC fails to catch final field
re-assign within constructor or initializer
[ https://issues.apache.org/jira/browse/GROOVY-10293?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Eric Milles updated GROOVY-10293:
---------------------------------
Issue Type: Bug (was: Improvement)
> STC fails to catch final field re-assign within constructor or initializer
> --------------------------------------------------------------------------
>
> Key: GROOVY-10293
> URL: https://issues.apache.org/jira/browse/GROOVY-10293
> Project: Groovy
> Issue Type: Bug
> Components: Static Type Checker
> Reporter: Eric Milles
> Priority: Major
>
> Follow up from GROOVY-5450. Consider the following:
> {code:groovy}
> @groovy.transform.TypeChecked
> class C{
> C(Cthat) {
> this.x = that.x
> that.x = this.x // error
> this.x = that.x // error
> }
> final x
> }
> {code}
> No error for assign of other's final field and no error for re-assign of own final field.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)