Slightly incorrect diagnostic

Mark Mahieu mark at twistedbanana.demon.co.uk
Thu May 15 14:05:12 PDT 2008


I've found another example where the compiler gives a slightly  
misleading compilation error:


public class WrongType {
	
     public static void main(String[] args) {
         {=>}.invoke(1);
     }
}


The message refers to an unrestricted type, yet I only have a  
restricted closure:

WrongType.java:4: invoke() in { ==> void} cannot be applied to (int)
                 {=>}.invoke(1);
                     ^
1 error



Regards,

Mark



More information about the closures-dev mailing list