interface Foo {} class FooImpl implements Foo {}
Object o = new FooImpl(); if (o instanceof Foo) -> compile error
The inability to even handle Java interfaces should be a clue right off the bat that this won't compile any non-trivial Java code base.
interface Foo {} class FooImpl implements Foo {}
Object o = new FooImpl(); if (o instanceof Foo) -> compile error
The inability to even handle Java interfaces should be a clue right off the bat that this won't compile any non-trivial Java code base.
Lambdas are meant to be used like in JavaScript. It totally works. JSweet supports function references (MyClass::myFunction) and defines the JS Function object for passing plain object functions. No need for getClass(), hashCode() or equals() in JavaScript.
Regarding interfaces, the situation is quite different. JSweet does not support interfaces in the way Java supports interfaces. JSweet interfaces are mapped to TypeScript interfaces which are pure compile-time entities used only for typing (which differ strongly from Java's). That's why the code you quote will not compile in JSweet, but it does not mean that JSweet is wrong: it means that your way of understanding an interface in JSweet is wrong (unlike Java, JSweet interfaces have no runtime representation). This part requires further documentation though... JSweet is a very young project.
Generally speaking, when you program with JSweet, you have to stop thinking too much in terms of Java semantics, and start thinking more in TypeScript or JavaScript, at least for some cases. The very most of it remains close to Java and very intuitive to programmers, since IMO, Java and TypeScript are quite in the same language family.