finos / rune-dsl

The project containing the Rune DSL grammar and default code generators
Apache License 2.0
25 stars 30 forks source link

Support choice types as enum #798

Open SimonCockx opened 2 months ago

SimonCockx commented 2 months ago

See part 4 of https://github.com/finos/rune-dsl/issues/747#issuecomment-2105050958.

4. Killer-feature: add support for using choice types as enum.

E.g.,

choice Asset as-enum AssetTypeEnum:
  ...

type Underlier:
  assetType AssetTypeEnum (1..1)

In an expression:

if underlier -> assetType = AssetTypeEnum -> Basket
then ...