Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Fixed
-
2.3.7
-
None
Description
Given this file:
SafeNavigation.groovy
@groovy.transform.CompileStatic class SafeNavigation { String name1 public String name2 public static void main(String[] args) { SafeNavigation test println test?.name1 // 'null' println test?.name2 // NullPointerException } }
an NPE will be thrown at the second line null safe navigation. Remove the @CompileStatic and the check works as expected.
Or see attached test case.