Github user danielsun1106 commented on the pull request:
https://github.com/apache/groovy/commit/c24c0b7e6a67dcdf277207d4261cfa6f2b55031f#commitcomment-27228202
In
src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java:
In
src/main/java/org/codehaus/groovy/transform/stc/StaticTypeCheckingVisitor.java
on line 4104:
Given `f` is a lambda, `f(2)` is actually `f.call(2)`. Groovy's STC will
check whether the invoked method exists in the specified class. If we use
`sam.getName()`, STC will still fail.
---