Closed
Description
Is your feature request related to a problem? Please describe
For numbers, for examples, it should be possible to express that only a finite set of values is legal. This could be expressed by enum but that's quite cumbersome and you can no longer operate on enums like you could on, say, numbers.
Desired solution
Literal types: literal<"a", 1, true>
Open tasks
- Scoping for members. Example: On something of type
literal<"a", "b">
, we can access any members ofString
. On something of typeliteral<"a", 1>
, we can access any members ofAny
. On something of typeliteral<"a", 1, null>
, we can still access any member ofAny
(scoping), but must use a safe access (validation). - Test
TypeComputer.computeClassTypeForLiteralType
Metadata
Metadata
Assignees
Type
Projects
Status
✔️ Done