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
Create a minimal grammar containing an entry rule, and reference to a rule of name 'Error'
Run langium generator3.
Run build
See error something like:
src/language-server/generated/ast.ts:59:27 - error TS2351: This expression is not constructable.
Type 'String' has no construct signatures.
59 throw new Error(`${referenceId} is not a valid reference id.`);
Which makes sense given the content of the generated ast.ts:
Thanks for the report @RGHenderson! We should probably add reserved names for built-in JavaScript types. The only other option would be to rename them automatically, which would be quite unintuitive for users.
Langium version: 0.3.0
Package name: langium
Steps To Reproduce
Which makes sense given the content of the generated ast.ts:
Minimal grammar which causes error:
The current behavior
Langium allows the definition of conflicting AST element names, causing the above build error.
The expected behavior
Either the generated AST will be more smart, OR langium grammars are validated against reserved rule names.
The text was updated successfully, but these errors were encountered: