Daniil Ovchinnikov created GROOVY-8241:
------------------------------------------

             Summary: 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)

Reply via email to