Whoops, a standalone example works. For some reason this project's build runs scalac across the .java files, and scalac perhaps obviously hasn't been updated for extension methods.
Sorry for the noise. On Mon, Sep 17, 2012 at 2:02 PM, Ricky Clarkson <[email protected]> wrote: > Hi, > > I'm just looking at lambdaifying a private branch of the library > Functional Java for fun, and have downloaded today's Lambda edition of > Java 8. > > FJ's 'function' class, F, is unfortunately a class not an interface, > with a lot of final instance methods, and the lambda conversion only > targets interface types, not class types, so that needs converting to > an interface. I'm hoping to do that using extension methods so that > callers don't need changing, but I can't seem to make extension > methods work or even be recognised by the compiler. As far as I can > gather, they should look like this: > > void foo() default { > System.out.println("Subtype was too lazy to define foo(), so we're > using this default."); > } > > The compiler just reports that it expects a ; where I have 'default', > which is what I'd expect on Java 7 or earlier. > > Is there somewhere I can look to see the status of that integration, > or if my syntax is wrong here where can I see the correct syntax? > Also, is 'final' ok there instead of 'default'? > > Cheers, > Ricky. -- You received this message because you are subscribed to the Google Groups "Java Posse" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/javaposse?hl=en.
