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

Enum members aren't subtype reduced in unions #10

Open
DanielRosenwasser opened this issue Jul 16, 2020 · 2 comments
Open

Enum members aren't subtype reduced in unions #10

DanielRosenwasser opened this issue Jul 16, 2020 · 2 comments
Labels
has repro indicates there's a twoslash repro in the issue

Comments

@DanielRosenwasser
Copy link
Member

enum E {
    A,
    B,
    C,
}

function f(x: E | undefined) {
//       ^?
    return x ?? E.C;
}

Workbench Repro

@DanielRosenwasser DanielRosenwasser added the has repro indicates there's a twoslash repro in the issue label Jul 16, 2020
@DanielRosenwasser
Copy link
Member Author

@typescript-bot
Copy link

typescript-bot commented Apr 13, 2022

👋 Hi, I'm the Repro bot. I can help narrow down and track compiler bugs across releases! This comment reflects the current state of the repro in the issue body running against the nightly TypeScript.


Issue body code block by @DanielRosenwasser

⚠️ Assertions:

  • function f(x: E | undefined): E

Historical Information
Version Reproduction Outputs
4.2.2, 4.3.2, 4.4.2, 4.5.2, 4.6.2

⚠️ Assertions:

  • function f(x: E | undefined): E

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has repro indicates there's a twoslash repro in the issue
Projects
None yet
Development

No branches or pull requests

2 participants