Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.4.10
-
None
Description
Input files:
Test.groovy
class Test { static org.springframework.util.MultiValueMap map = [:] // class from spring-core:4.2.6-RELEASE static void main(String[] args) { println map } }
compiler-config.groovy
import groovy.transform.CompileStatic
withConfig(configuration)
{ ast(CompileStatic) }
Error:
org.codehaus.groovy.runtime.typehandling.GroovyCastException: Cannot cast object '{}' with class 'java.util.LinkedHashMap' to class 'org.springframework.util.MultiValueMap' due to: groovy.lang.GroovyRuntimeException: Could not find matching constructor for: org.springframework.util.MultiValueMap(java.util.LinkedHashMap)
Expected behavior: either compile time error or handle it correctly during runtime