moonfruit commented on pull request #1339:
URL: https://github.com/apache/groovy/pull/1339#issuecomment-670842757
When define method in a class like this:
```groovy
@CompileStatic
class App {
@NamedVariant(coerce = true)
void run(int number) {
println(number)
}
}
```
The generated method will also be compiled statically. So when I call the
method:
```groovy
run(number: "123")
```
It will call `DefaultGroovyMethods.asType()` instead of
`StringGroovyMethods.asType()`, so the string cannot convert to integer
properly. So I must skip `@CompileStatic`.
In order to achieve this goal, I skip type checking explicitly.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]