Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Duplicate
-
None
-
None
-
None
Description
This seems related to GROOVY-11012.
I have the following program
@Grab('org.apache.commons:commons-collections4:4.4') import org.apache.commons.collections4.iterators.*; class Main { @groovy.transform.TypeChecked test() { EmptyListIterator<Number> tmp = null Number x = tmp.next() } }
Actual behavior
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: test.groovy: 6: [Static type checking] - Cannot assign value of type java.lang.Object to variable of type java.lang.Number @ line 6, column 16. Number x = tmp.next(); ^ 1 error
Expected behavior
Compile successfully
Notes
Tested against master (commit: ed4b33c8d5ac71ee4963d6bb391850593c59e5b1)
Attachments
Issue Links
- is related to
-
GROOVY-8638 CompileStatic fails with Guava Multimap#asMap
- Closed
-
GROOVY-10109 IllegalAccessError with package-access base class
- Closed
-
GROOVY-10120 STC: Guava Multimap#asMap bridge method
- Closed
-
GROOVY-10136 [JDK16] Failed to find `public` method derived from `package` super class
- Closed
-
GROOVY-11012 Wrong type is inferred when calling method defined in the parent class
- Closed