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

Properly propagate silentNeverType in unions #60866

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Andarist
Copy link
Contributor

When investigating some other issue and debugging it I noticed that silentNeverType | silentNeverType was reduced to a regular never. I think this is a mistake and this PR basically applies the same fix as the one done for intersections here: #45073

@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Dec 28, 2024
@typescript-bot
Copy link
Collaborator

This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise.

Comment on lines +30 to +35
declare function inner<T1, t2>(t1: T1, t2: t2): T1 | t2;
declare function outer<T1, T2>(m: T1 | T2): [T1, T2];

const outerResult = outer(
inner({ a: 12 }, { foo() { return true } })
);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this test case is utterly non-sensical but it shows a behavior/consistency improvement introduced by this patch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Uncommitted Bug PR for untriaged, rejected, closed or missing bug
Projects
Status: Not started
Development

Successfully merging this pull request may close these issues.

2 participants