Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: decoupled Type-Switch for Nested Enums? #33

Open
vknabel opened this issue Feb 17, 2022 · 0 comments
Open

Proposal: decoupled Type-Switch for Nested Enums? #33

vknabel opened this issue Feb 17, 2022 · 0 comments
Labels
proposal Lithia Evolution proposal or draft

Comments

@vknabel
Copy link
Owner

vknabel commented Feb 17, 2022

When defining an enum which contains another enum, all type-switches are required to address the nested enum by its name. Explicitly only matching one single case is not possible.

This should be changed.

enum Maybe {
  Optional
  Any
}

// currently possible
type Maybe {
  Optional: { => },
  Any: { => }
}

// proposal
type Maybe {
  Some: { => },
  None: { => },
  Any: { => }
}
@vknabel vknabel added feature New feature or request compiler labels Feb 17, 2022
@vknabel vknabel added this to the All Language Features milestone Feb 17, 2022
@vknabel vknabel added this to Lithia Feb 17, 2022
@vknabel vknabel moved this to Backlog in Lithia Feb 17, 2022
@vknabel vknabel moved this from Backlog to Upcoming in Lithia Feb 17, 2022
@vknabel vknabel moved this from Upcoming to Backlog in Lithia Dec 28, 2022
@vknabel vknabel changed the title Feature: decoupled Type-Switch for Nested Enums Proposal: decoupled Type-Switch for Nested Enums Dec 28, 2022
@vknabel vknabel changed the title Proposal: decoupled Type-Switch for Nested Enums Proposal: decoupled Type-Switch for Nested Enums? Dec 28, 2022
@vknabel vknabel added proposal Lithia Evolution proposal or draft and removed feature New feature or request compiler labels Feb 3, 2023
@vknabel vknabel removed this from the All Language Features milestone Jul 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal Lithia Evolution proposal or draft
Projects
Status: Backlog
Development

No branches or pull requests

1 participant