Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.5.x
-
None
Description
def method() { final z = null if (z != null) { z = 3 } }
gives error message:
1 compilation error: The variable [z] may be uninitialized . At [5:11] at line: 5, column: 11
it should be a compile error since we are reassigning z, but the error message should be:
The variable [z] is declared final but is reassigned