[ https://issues.apache.org/jira/browse/GROOVY-11273?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17805829#comment-17805829 ]
Eric Milles commented on GROOVY-11273: -------------------------------------- Does the AutoFinal transform work for interface default, private and static methods? > Fail to identify updates on final variables declared in default methods > ----------------------------------------------------------------------- > > Key: GROOVY-11273 > URL: https://issues.apache.org/jira/browse/GROOVY-11273 > Project: Groovy > Issue Type: Bug > Components: Static Type Checker > Reporter: Thodoris Sotiropoulos > Assignee: Paul King > Priority: Minor > Labels: default-methods > Fix For: 5.0.0-alpha-5 > > > I have the following ill-typed program: > {code} > interface Test { > default void test() { > final int x = 1; > x = 2; > } > } > {code} > h3. Actual behavior > The code compiles successfully > h3. Expected behavior > Code rejected with: > {code} > org.codehaus.groovy.control.MultipleCompilationErrorsException: startup > failed: > test.groovy: 4: The variable [x] is declared final but is reassigned > . At [4:5] @ line 4, column 5. > x = 2; > ^ > 1 error > {code} > Tested against master (commit: 3cd76364f772250324f5729ef93ffd76fbdd2b79) -- This message was sent by Atlassian Jira (v8.20.10#820010)