Unexpected "Cannot add supertype 'X' to sealed type 'Y'"
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 42/100
Research direction
Open the attached mydsl.zip sample and reproduce the marker for the CallOrAssignStatement parser rule shown in the issue. Trace how the declared return type and the assigned actions are validated, then confirm that a valid rule no longer reports the unexpected sealed-type error.
Written by the indexing model from the issue text.
Description
For the following parser rule I get an error marker "Unexpected "Cannot add supertype 'Statement' to sealed type 'FeatureCall'":
CallOrAssignStatement returns Statement:
FeatureCall
(
{AssignStatement.target=current} ':=' value=INT
| {CallStatement.expression=current}
)
';'
;
Since the rule should always return an instance of AssignStatement or CallStatement it seems wrong to me that Xtext requires FeatureCall to also be a subtype of the declared return type Statement. Or what am I missing here?
Full sample project attached: mydsl.zip
- Dominant language
- Java
- Stars
- 831
- Forks
- 330
- Avg merge
- 3d 7h
- Merged PRs (30d)
- 12
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.
More from eclipse-xtext/xtext
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
eclipse-xtext/xtext#3727 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
eclipse-xtext/xtext#3668 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
eclipse-xtext/xtext#3797 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
eclipse-xtext/xtext#3796 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 68/100
eclipse-xtext/xtext#3795 · 1 comment ·
All issues in eclipse-xtext/xtext
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
bug needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 1/5 Under an hour Newbie friendliness 94/100
objectionary/hone-maven-plugin#1061 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
spring-projects/spring-modulith#1895 ·