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

Reply via email to