Github user jespersm commented on the pull request:
https://github.com/apache/groovy/commit/c24c0b7e6a67dcdf277207d4261cfa6f2b55031f#commitcomment-27234087
In src/main/java/org/codehaus/groovy/classgen/asm/InvocationWriter.java:
In src/main/java/org/codehaus/groovy/classgen/asm/InvocationWriter.java on
line 483:
@avafanasiev asked:
> Is it acceptable groovy method dispatch depends on declared type?
Good example - since there's a gotcha: Today, all three will *fail* since
"call" is missing (unless you're fiddling with R.metaClass).
I get what you're saying, the three calls should work the same in dynamic
groovy. In what I'm proposing, all three would call "run()", since R implements
Runnable, and Runnable is a SAM.
Using @CompileStatic, r1() and r2() would compile, but r3() would complain
that r3 has no call method and is not a SAM.
---