groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul King <pa...@asert.com.au>
Subject Re: Functional interfaces and CompileStatic
Date Thu, 07 Dec 2017 23:34:41 GMT
I believe this is a known bug/limitation with an existing Jira.

On Fri, Dec 8, 2017 at 5:39 AM, Nathan Harvey <nathanwharvey@gmail.com>
wrote:

> Apologies, the mailing list removed my code (forum, anyone?). Here it is:
>
> @CompileStatic
> class SampleClass {
>         public void sample(Consumer<String> consumer) {}
>         public static void main(String[] args) {
>                 new SampleClass().sample({ String str -> str.toUpperCase()
> }) // passes
>                 new SampleClass().sample({ it.toUpperCase() }) // passes
>                 new SampleClass().sample({ str -> it.toUpperCase() }) //
> fails
>         }
> }
>
>
>
> --
> Sent from: http://groovy.329449.n5.nabble.com/Groovy-Dev-f372993.html
>

Mime
View raw message