[
https://issues.apache.org/jira/browse/GROOVY-12315?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Daniel Sun reassigned GROOVY-12315:
-----------------------------------
Assignee: Daniel Sun
> Type for final field should be known by flow-typing
> ---------------------------------------------------
>
> Key: GROOVY-12315
> URL: https://issues.apache.org/jira/browse/GROOVY-12315
> Project: Groovy
> Issue Type: Bug
> Affects Versions: 6.0.0-alpha-1, 5.0.3, 4.0.31
> Reporter: Björn Kautler
> Assignee: Daniel Sun
> Priority: Major
>
> This does not compile, while the type should be clear as the field is final:
> {code:java}
> @groovy.transform.CompileStatic
> class Foo {
> final bar = ''
> def foo() {
> println(bar.length())
> }
> }
> new Foo().foo() {code}
> With a local variable it works even without {{{}final{}}}.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)