Skip to content

Literal types #80

Closed
Closed
@lars-reimann

Description

@lars-reimann

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 of String. On something of type literal<"a", 1>, we can access any members of Any. On something of type literal<"a", 1, null>, we can still access any member of Any (scoping), but must use a safe access (validation).
  • Test TypeComputer.computeClassTypeForLiteralType

Metadata

Metadata

Assignees

Labels

dsl 🗒️Issues regarding the domain specific programming languagereleasedIncluded in a release

Type

No type

Projects

Status

✔️ Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions