-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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 #35867
Comments
Related: #32621? |
enum E {
A,
B,
C,
}
function f(x: E | undefined) {
// ^?
return x ?? E.C;
} |
I think this is fixed now. Would we have any volunteers willing to add a test case to prevent regressions? |
👋 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
Historical Information
|
👋 Hi, I'm the Repro bot. I can help narrow down and track compiler bugs across releases! This comment reflects the current state of this repro running against the nightly TypeScript.
Historical Information
|
Signed-off-by: Lawrence Craft <[email protected]>
#68) * Add case to capture enum subtype reduction (addresses microsoft#35867) Signed-off-by: Lawrence Craft <[email protected]>
Expected
f
to have typeE
, but instead it has typeE | E.C
Playground
Doesn't have anything to do with
??
- can reproduce it with||
.The text was updated successfully, but these errors were encountered: