groovy
groovy copied to clipboard
GROOVY-9999,GROOVY-8488:STC:make decimal literal parameter can auto c…
fix GROOVY-9999,GROOVY-8488, in general, make literal such as "4.0" could be use in double param method such as "Math.sqrt(double a)".
For STC, there are a couple methods that check the compatibility of arguments and parameters or source and target types. I would expect a change in one of these to allow BigDecimal as argument to double parameter. I'm not sure of the reason for the change to make BigDecimal not convert as before. It would be good to understand why this stopped working at some point.
In terms of tests, we are slowly migrating away from GroovyTestCase and GroovyShell#evaluate in favor of JUnit 4 and GroovyAssert#assertScript. It appears you have taken us in the reverse direction.
For STC, there are a couple methods that check the compatibility of arguments and parameters or source and target types. I would expect a change in one of these to allow
BigDecimalas argument todoubleparameter. I'm not sure of the reason for the change to makeBigDecimalnot convert as before. It would be good to understand why this stopped working at some point.In terms of tests, we are slowly migrating away from
GroovyTestCaseandGroovyShell#evaluatein favor of JUnit 4 andGroovyAssert#assertScript. It appears you have taken us in the reverse direction.
@eric-milles Is the method "StaticTypeCheckingVisitor#findMethod" designed to "check the compatibility of arguments and parameters or source and target types"?
That method returns empty mn in "StaticTypeCheckingVistor:3479",and causes "GROOVY-9999","GROOVY-8488". And my idea is to write a new method "StaticTypeCheckingVisitor#bigDecimalCast" to “check the compatibility”。 Maybe I should integrate the logic of "bigDecimalCast" into "findMethod"?
And could you tell me all "methods that check the compatibility of arguments and parameters or source and target types"? That may help to solve GROOVY-8168 which is possible caused by similar method like "StaticTypeCheckingVisitorfindMethod".