Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.4.7
-
None
Description
Given a property of type Map<String, Object> and the assignment:
myObject.property = ['myKey':"${buildDir}/file-cache"]
I get the following error:
[Static type checking] - Cannot assign value of type java.util.LinkedHashMap <java.lang.String, groovy.lang.GString> to variable of type java.util.Map <java.lang.String, java.lang.Object>
I have to manually cast the value to Object for it to work without warnings:
myObject.property = ['myKey': "${buildDir}/file-cache" as Object]
This should not be needed, since any object is a valid instance of Object