Details
-
Improvement
-
Status: Closed
-
Trivial
-
Resolution: Fixed
-
2.4.0
-
None
Description
Currently we have to do this:
@CompileStatic ... inserter.createNode([v: it.value, l: it.language] as Map<String, Object>, labelLabel)
If not we'll get:
Error:(81, 37) Groovyc: [Static type checking] - Cannot call org.neo4j.unsafe.batchinsert.BatchInserter#createNode(java.util.Map <java.lang.String, java.lang.Object>, org.neo4j.graphdb.Label[]) with arguments [java.util.LinkedHashMap <java.lang.String, java.lang.String>, org.neo4j.graphdb.Label]
But since the caller requests Map<String, Object>, Groovy can create the hashmap as <String, Object> instead of <String, String>... saving us from explicit type coercion even with @CompileStatic. (similar to Java7's diamond operator)
Attachments
Issue Links
- is related to
-
GROOVY-7106 Improve coercion / implicit cast of map literals for @CompileStatic
- Closed