Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.3.0, 2.3.1
-
None
Description
I cannot compile this code with 2.3.0.
import groovy.transform.TypeChecked @TypeChecked class TypeTest { static interface Map2<K,V> extends Map<K,V> {} static void main(String[] args) { Map2 map = null if (map == null) println "map is null" } }
The error message is
Error:(9, 13) Groovyc: [Static type checking] - Reference to method is ambiguous. Cannot choose between boolean java.util.Map#equals(java.util.Map), boolean java.util.Map <K extends java.lang.Object, V extends java.lang.Object>#equals(java.lang.Object)
I can compile if I change it to this.
if (map == (Object) null)
Also I can compile this too.
Map map = null if (map == null) println "map is null"