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

Add support for as <ident> to pattern matching #363

Open
kevinbarabash opened this issue Sep 2, 2024 · 0 comments
Open

Add support for as <ident> to pattern matching #363

kevinbarabash opened this issue Sep 2, 2024 · 0 comments
Labels
bug Something isn't working Type Safety

Comments

@kevinbarabash
Copy link
Contributor

This is so that we can mutate discriminated unions, e.g.

        declare let mut foo: { type: "a", v: number } | {type: "b", v: string };
        match foo {
          {type: "a"} as foo => foo.v = 5,
          {type: "b"} as foo => foo.v = "hello",
        };
@kevinbarabash kevinbarabash added bug Something isn't working Type Safety labels Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Type Safety
Projects
None yet
Development

No branches or pull requests

1 participant