You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A compilation error is produced on number.toBigDecimal() because number is detected as Object rather than Number.
Please note that:
this was compiling fine with some versions of Greclipse ago (cannot say exactly which one now)
this compiles fine with Gradle/groovyc
switching to @CompileDynamic makes things work
I have other more complex use cases in my real-world project which I think are related to this same problem. It seems like Greclipse is simply ignoring now the type I'm declaring for closure arguments.
The text was updated successfully, but these errors were encountered:
mauromol
changed the title
Static type checking fails in Greclipse within closure
Static type checking fails in Greclipse within closure (closure declared argument types ignored)
Dec 30, 2021
I am still sorting out the parameter type recognition. STC wants to compare the declared types to the inferred types at some point so it can create errors for incompatible types.
Using Greclipse 4.4.0.v202112282355-e2009.
Consider this Java utility class:
and this Groovy class:
A compilation error is produced on
number.toBigDecimal()
becausenumber
is detected asObject
rather thanNumber
.Please note that:
@CompileDynamic
makes things workI have other more complex use cases in my real-world project which I think are related to this same problem. It seems like Greclipse is simply ignoring now the type I'm declaring for closure arguments.
The text was updated successfully, but these errors were encountered: