default values with optional attributes #1399
Unanswered
Yokozuna59
asked this question in
Q&A
Replies: 1 comment 7 replies
-
The grammar type system mostly follows the same logic as TypeScript's type system. In TypeScript: class X {
readonly value?: string = 'default';
} The |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I have a question regarding the default values feature: what is the expected result when having an optional attribute with a default value?
For example, the Langium interface:
My thought was that it doesn't have to be parsed, but it would be required, not optional, in the TS interface:
But it's not the case I guess.
Beta Was this translation helpful? Give feedback.
All reactions