Björn Kautler created GROOVY-12315:
--------------------------------------

             Summary: 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: 4.0.31, 5.0.3, 6.0.0-alpha-1
            Reporter: Björn Kautler


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
(v8.20.10#820010)

Reply via email to