Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
This is a follow up of https://issues.apache.org/jira/browse/GROOVY-9985
After the bug fix of the above GROOVY-9985, STC indeed catches the type error in the following program
public class Main { public static void main(String[] args) { Integer[] arr = new Integer[] {"fd" 1}; // compile-time error here Integer y = arr[0]; } }
However, STC still is not able to catch type errors like the following
public class Main { public static void main(String[] args) { Integer[] arr = new Integer[] {new Object(), 1}; // STC misses the error here Integer y = arr[0]; // ClassCastException at runtime } }