cincheo / jsweet

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

Inline override in enum not supported #560

Closed lucgirardin closed 4 years ago

lucgirardin commented 4 years ago

Added two additional enum definitions to the test cases: ToStringEnum doesn't compile while ToStringInnerEnum does.

lgrignon commented 4 years ago

Thanks @lucgirardin, this is a tricky case. Would you want to try to implement it?

lucgirardin commented 4 years ago

I will certainly have a look whether there is a simple solution to handle this tricky case. Of course, it took me seconds to modify my code so that it is compatible with JSweet, so the incentive to find a complete solution is low. I have a few additional cases I could add. The question is how much you want JSweet to be compatible with Java. One possibility could simply be to document these cases (as issues?) so that other users can be directed to workarounds. The other could be to just have a list of additional test cases that JSweet do not currently handle, so that eventually somebody will fix them. What's your take?

lgrignon commented 4 years ago

Thanks for your answer. Having unsupported cases in an @Ignore test class could help, nice idea!

For the record, our wish is to stick as much as possible to the Java syntax but we are willing to accept a small percentage of.unsupported constructs if they are unusual.

I hope my answer will clarify how we stand. Please tell me if you have any other question.

We could keep this PR opened and perhaps change the title to "add a @ignore test class to list unsupported transpilation cases" what do you think?

lgrignon commented 4 years ago

Nevermind, I will merge as is :)

lucgirardin commented 4 years ago

That's sweet... thanks for being lenient, I was underwater lately!