You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have this code that gives me this error, using EnumMap also gives a similar error: ERROR: type 'Permission' does not satisfy the constraint 'Enum<Permission>' at src\shared\Service.java(7)
I tried to find where that constraint is enforced in jsweet but didn't find where. The error message is confusing. Maybe jsweet doesn't translate enums into Enum<T?
That constraint is enforced by TypeScript compiler (tsc).
Indeed, it's specified in Java definition public abstract class EnumSet<E extends Enum<E>> extends AbstractSet<E> {
Hence will be transpiled as a TS generic constraint.
The problem is that your enum is transpiled to a standard TS enum which does not extend Enum of course (not possible in TS by the way). I recommend you try with this contraint removed. It's not a major one.
That being said, it could be nice that JSweet deals with this specificity when using J4TS, but it would require a non negligible amount of work.
I have this code that gives me this error, using EnumMap also gives a similar error:
ERROR: type 'Permission' does not satisfy the constraint 'Enum<Permission>' at src\shared\Service.java(7)
Here is the code.
The text was updated successfully, but these errors were encountered: