-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Fix of #58996 #59155
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
Fix of #58996 #59155
Conversation
@microsoft-github-policy-service agree |
src/compiler/checker.ts
Outdated
@@ -38409,7 +38409,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { | |||
// "x is T" means that x is T if and only if it returns true. If it returns false then x is not T. | |||
// This means that if the function is called with an argument of type trueType, there can't be anything left in the `else` branch. It must reduce to `never`. | |||
const falseCondition = createFlowNode(FlowFlags.FalseCondition, expr, antecedent); | |||
const falseSubtype = getFlowTypeOfReference(param.name, initType, trueType, func, falseCondition); | |||
const falseSubtype = getReducedType(getFlowTypeOfReference(param.name, initType, trueType, func, falseCondition)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice find 👍
@typescript-bot test it |
Hey @jakebailey, the results of running the DT tests are ready. Everything looks the same! |
@jakebailey Here are the results of running the user tests with tsc comparing Everything looks good! |
@jakebailey Here they are:
tscComparison Report - baseline..pr
System info unknown
Hosts
Scenarios
Developer Information: |
@jakebailey Here are the results of running the top 400 repos with tsc comparing Everything looks good! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this is correct, yes?
I think I meant to merge this back when I reviewed it; I can merge main if you'd like. |
Sure! |
Backlog
milestone (required)main
branchhereby runtests
locallyFixes #58996
The issue was that the type
Animal & Rock
was not getting reduced tonever
and therefore the check failed.