eclipse-xtext / eclipse-xtext/xtext
cannot convert X to Enum
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 831
- Forks
- 330
- Avg merge
- 3d 7h
- Merged PRs (30d)
- 12
Description
In a project we have inferred Enum classes extending an interface (Xtext language extending Xbase; model inferrer produces enum type adding an interface supertype). Further we have a method expecting any Enum as parameter (Enum<?> param). A call from an Xtend class to that method passing an inferred Enum fails to compile with the error "cannot convert to Enum". A call from the Xtend class passing an identical hand written Java-Enum (without the Xbase model in the background) succeeds.
This problem is present only in the IDE, a maven build of the project succeeds without compilation errors.
Reproducing the problem with Xtend alone seems not to be possible as the grammar does not allow defining an enum that implements an interface. The problem exists in Xtend 2.8 and was reproduced with 2.9 and 2.10.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue in an Xtext language extending Xbase, where the model inferrer creates an enum with an interface supertype and Xtend passes it to a method accepting Enum<?>. Compare the IDE result with the successful Maven build and handwritten Java enum case; no source file or test is named, so completion means the IDE accepts the inferred enum call without the conversion error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- compilers, devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100