Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
Description
I have the following ill-typed program:
interface Test { default void test() { final int x = 1; x = 2; } }
Actual behavior
The code compiles successfully
Expected behavior
Code rejected with:
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
Tested against master (commit: 3cd76364f772250324f5729ef93ffd76fbdd2b79)