Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
None
-
None
-
None
Description
I have the following program
class Test { public static void main(String [] args) { java.lang.Class<String> lapse = 1; } }
Actual behavior
The code compiles, but I get the following runtime error:
Caught: org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object '1' with class 'java.lang.Integer' to class 'java.lang.Class' due to: java.lang.ClassNotFoundException: 1 org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object '1' with class 'java.lang.Integer' to class 'java.lang.Class' due to: java.lang.ClassNotFoundException: 1 at Test.main(test.groovy:3)
Expected behavior
The code should have been rejected
Tested against master (commit: e6b9133726af9cdea2bc6db7b55523cd88f7190e)