Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
3.0.3
-
None
Description
Script:
import groovy.transform.CompileStatic interface SimpleFeatureMap extends Map<Object, Object> {} interface FeatureMap extends SimpleFeatureMap{} class FeatureMapImpl extends HashMap<Object, Object> implements FeatureMap {} @CompileStatic class Test { FeatureMap newMap() { new FeatureMapImpl() } String test() { FeatureMap map = newMap() map['asd'] } } new Test().test()
Result:
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: ideaGroovyConsole.groovy: 14: [Static type checking] - Reference to method is ambiguous. Cannot choose between [V java.util.Map <K, V>#getAt(java.lang.Object), java.lang.Object java.lang.Object#getAt(java.lang.String)] @ line 14, column 9. map['asd'] ^ 1 error at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:287) at org.codehaus.groovy.control.CompilationUnit$IPrimaryClassNodeOperation.doPhaseOperation(CompilationUnit.java:963) at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:650) at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:627) at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:389) at groovy.lang.GroovyClassLoader.lambda$parseClass$3(GroovyClassLoader.java:332) at org.codehaus.groovy.runtime.memoize.StampedCommonCache.compute(StampedCommonCache.java:163) at org.codehaus.groovy.runtime.memoize.StampedCommonCache.getAndPut(StampedCommonCache.java:154) at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:330) at groovy.lang.GroovyShell.parseClass(GroovyShell.java:526) at groovy.lang.GroovyShell.run(GroovyShell.java:359) at groovy.lang.GroovyShell.run(GroovyShell.java:339)