cincheo / jsweet

A Java to JavaScript transpiler.
http://www.jsweet.org
Other
1.46k stars 160 forks source link

Enum wrapper class not implementing default methods from implemented interfaces #397

Open N3mezis opened 6 years ago

N3mezis commented 6 years ago

Hi! First of all thanks for writing such a neat tool! I would like to argue that in the following piece of code, the switch for Kind.ENUM prevents the wrapper class of an enum from implementing defaults methods from its implemented interfaces.

https://github.com/cincheo/jsweet/blob/16e9d411571b806ea8de106a5dc2996f697eb8f2/transpiler/src/main/java/org/jsweet/transpiler/Java2TypeScriptTranslator.java#L1343-L1368

This leads to a compiler error that the wrapper class is incorrectly implementing the interface. Is there any reason for excluding the default implementations for the case classdecl.getKind() == Kind.ENUM && getScope().enumWrapperClassScope == true?

renaudpawlak commented 6 years ago

@N3mezis thank you for reporting. Could you please send an example (smallest code as possible) that fails, so that I can see exactly what is wrong and integrate a new JUnit test? Thank you.