[ 
https://issues.apache.org/jira/browse/GROOVY-8317?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Daniel Sun closed GROOVY-8317.
------------------------------
       Resolution: Fixed
         Assignee: Daniel Sun
    Fix Version/s: 3.0.0-alpha-2
                   2.4.14
                   2.6.0-alpha-3
                   2.5.0-beta-3

Fixed by 
https://github.com/apache/groovy/commit/bd5191d9a8858945a4d83df58e261eb56bec0ab7

Thanks for the patch!

> Smart type inference doesn't work on explicit closure params
> ------------------------------------------------------------
>
>                 Key: GROOVY-8317
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8317
>             Project: Groovy
>          Issue Type: Bug
>          Components: Static compilation, Static Type Checker
>            Reporter: Alexey Afanasiev
>            Assignee: Daniel Sun
>             Fix For: 2.5.0-beta-3, 2.6.0-alpha-3, 2.4.14, 3.0.0-alpha-2
>
>
> Should be compiled well:
> {code}
> @CompileStatic
> class TestType {
>     static def bar(Object b) {
>         b.with { obj ->
>             assert obj instanceof String
>             obj.toUpperCase() // error: Cannot find matching method 
> java.lang.Object#toUpperCase(). 
>         }
>     }
> }
> {code}
> Funny moment - on implicit 'it' parameter works fine:
> {code}
> @CompileStatic
> class TestType {
>     static def bar(Object b) {
>         b.with {
>             assert it instanceof String
>             it.toUpperCase()
>         }
>     }
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to