Skip to content

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 <[email protected]>
@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 😅

@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 22, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

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