Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.0.0
-
None
Description
The following code:
import java.lang.reflect.Array @groovy.transform.CompileStatic def arrayTest() { Object[] joinedArray = (Object[]) Array.newInstance(Integer.class, 10); }
Results in
[Static type checking] - Inconvertible types: cannot cast java.lang.reflect.Array to [Ljava.lang.Object; at line: 5, column: 27
The DGM newInstance method is being used instead of http://docs.oracle.com/javase/6/docs/api/java/lang/reflect/Array.html#newInstance(java.lang.Class,%20int)
Attachments
Issue Links
- is duplicated by
-
GROOVY-5607 @Compile static Sql.newInstance
- Closed