Details
-
Bug
-
Status: Closed
-
Blocker
-
Resolution: Fixed
-
2.0.4
-
None
Description
With Static Compilation enabled, if I try to call a method declared in a class that receives a parameter of type java.lang.Byte, the compilation fails, returning "[Static type checking] - Cannot find matching method".
The same problem occurs when calling a method from inside another method, for instance:
Test.gvy
@groovy.transform.CompileStatic void testMethod(java.lang.Byte param){ println(param) } @groovy.transform.CompileStatic void run (){ testMethod(java.lang.Byte.valueOf("123")) } run()
The problem seems to be in the "isAssignableTo" method from "org.codehaus.groovy.transform.stc.StaticTypeCheckingSupport.java" class, where ClassHelper.Byte_TYPE doesn't match the type received as an argument, probably because you are not using the redirect() method before comparing with the type that matters.