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 case to capture enum subtype reduction (addresses #35867) #49675

Merged
merged 1 commit into from
Jun 24, 2022

Conversation

lawrencecraft
Copy link
Contributor

Describe your changes

I've added a few tests to address the behavior described in #35867. The issue itself is fixed, but these tests will help catch regressions. Once this is merged the bug should be able to be closed.

Testing performed

I added cases for lots of permutations of this subtype reduction and checked the output to ensure the correct types were being returned. Everything looked good, including Typescript cleverly narrowing to unions of enums when values are falsy and the || operator would filter them out.

Thanks to @acutmore and @mkubilayk for the reviews and help on this!

Fixes #35867

#68)

* Add case to capture enum subtype reduction (addresses microsoft#35867)

Signed-off-by: Lawrence Craft <lcraft6@bloomberg.net>
@typescript-bot typescript-bot added the For Backlog Bug PRs that fix a backlog bug label Jun 24, 2022
@ghost
Copy link

ghost commented Jun 24, 2022

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.

❌ lawrencecraft sign now
You have signed the CLA already but the status is still pending? Let us recheck it.

@RyanCavanaugh RyanCavanaugh merged commit ad6d086 into microsoft:main Jun 24, 2022
@RyanCavanaugh
Copy link
Member

Oops, please sign the CLA so I don't have to revert that...

@mkubilayk
Copy link
Contributor

@RyanCavanaugh CLA bot used to auto-accept PRs coming from the Bloomberg fork. Do you know if anything changed related to that? We have seen it not working on this PR and also in #49649, #49639, #49636.

@RyanCavanaugh
Copy link
Member

That happens to be the thing I'm working on right now 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Backlog Bug PRs that fix a backlog bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enum members aren't subtype reduced in unions
4 participants