[ https://issues.apache.org/jira/browse/GROOVY-8241?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16285869#comment-16285869 ]
ASF GitHub Bot commented on GROOVY-8241: ---------------------------------------- GitHub user avafanasiev opened a pull request: https://github.com/apache/groovy/pull/643 GROOVY-8241 SAM parameter type inference for explicit parameter It should fix GROOVY-8241, GROOVY-7061, GROOVY-8317. You can merge this pull request into a Git repository by running: $ git pull https://github.com/avafanasiev/groovy master Alternatively you can review and apply these changes as the patch at: https://github.com/apache/groovy/pull/643.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #643 ---- commit dcbc41e591a65895e4a4f47eca78488d8ea0603b Author: alexey.afanasiev <alexey.afanas...@jetbrains.com> Date: 2017-12-11T13:01:02Z GROOVY-8241 SAM parameter type inference for explicit parameter ---- > SAM parameter type inference for explicit parameter > --------------------------------------------------- > > Key: GROOVY-8241 > URL: https://issues.apache.org/jira/browse/GROOVY-8241 > Project: Groovy > Issue Type: Bug > Components: Static compilation, Static Type Checker > Affects Versions: 2.4.10 > Reporter: Daniil Ovchinnikov > > {code} > import groovy.transform.CompileStatic > import java.util.function.Predicate > @CompileStatic > static boolean foo(Predicate<? super String> p) { > p.test("foo") > } > @CompileStatic > static def testPredicate() { > foo { // it -> > it.toUpperCase() > true > } > } > {code} > Uncomment {{it}}, compiler will say: > {noformat} > Cannot find matching method java.lang.Object#toUpperCase() > {noformat} -- This message was sent by Atlassian JIRA (v6.4.14#64029)