-
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
Don't avoid caching variable types resolved using CheckMode.TypeOnly
#59075
Don't avoid caching variable types resolved using CheckMode.TypeOnly
#59075
Conversation
This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise. |
@@ -11994,7 +11994,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { | |||
// to preserve this type. In fact, we need to _prefer_ that type, but it won't | |||
// be assigned until contextual typing is complete, so we need to defer in | |||
// cases where contextual typing may take place. | |||
if (!links.type && !isParameterOfContextSensitiveSignature(symbol) && !checkMode) { | |||
if (!links.type && !isParameterOfContextSensitiveSignature(symbol) && !(checkMode & ~CheckMode.TypeOnly)) { |
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.
this cache suppression was introduced in #56753 and its original PR #50586 was first created before CheckMode.TypeOnly
was even a thing (that was introduced in #54380 )
It would be an easy thing to miss either way but partially the bug was born because that PR was long-lived and a new concept was introduced to the checker in the meantime.
@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! |
Related: #59177 (comment) |
Fixes the weird behavior observed in #59074