Langium version: 4.1.0
Package name: ?
Steps To Reproduce
- Write the grammar below
- Run
npm run langium:generate
Code example:
grammar HelloWorld
interface Root {
color: Color
}
type Color = 'red' | 'blue' | 'green';
entry RootRule returns Root:
'color' color=ColorRule
;
ColorRule returns Color:
'red' | 'blue' | 'green'
;
hidden terminal WS: /\s+/;
hidden terminal ML_COMMENT: /\/\*[\s\S]*?\*\//;
hidden terminal SL_COMMENT: /\/\/[^\n\r]*/;
The current behavior
src/hello-world.langium:11:13 - The assigned type 'ColorRule' is not compatible with the declared property 'color' of type 'Color'.
Screenshot:

The expected behavior
The grammar should work without type error.