Mezentsev Denis Ivanovich created GROOVY-8476:

             Summary: Static type checking doesn't inference argument's type 
when it's explicitly declared
                 Key: GROOVY-8476
             Project: Groovy
          Issue Type: Bug
          Components: Static compilation
    Affects Versions: 2.4.13, 2.4.3
         Environment: Linux workstation 4.14.17-1-lts
Java HotSpot(TM) 64-Bit Server VM (build 25.151-b12, mixed mode)
Groovy compiler version 2.4.13
            Reporter: Mezentsev Denis Ivanovich
         Attachments: ArgumentTypeCheck.groovy

I can't compile closure without argument's type declaration with or without 
indy flag:
class ArgumentTypeCheck {
    void implicitArgument() { [foo: 1].entrySet().stream().map({ it.value }) }

    void explicitArgument() { [foo: 1].entrySet().stream().map({ it -> it.value 
}) }
implicitArguments is compiled, but often I want to use outer `it` in second 
level closure, for instance in flatMap and don't want declare argument type.

Why is implicitArgument method compiled successfully?

This message was sent by Atlassian JIRA

Reply via email to