-
Notifications
You must be signed in to change notification settings - Fork 13k
Defer checking call and new expressions with context sensitive arguments #62381
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
base: main
Are you sure you want to change the base?
Conversation
@@ -190,8 +190,8 @@ test("windows-process-tree", async () => { | |||
> : ^^^^^^^^^^^^ | |||
>"windows-process-tree" : "windows-process-tree" | |||
> : ^^^^^^^^^^^^^^^^^^^^^^ | |||
>async () => { return new Promise((resolve, reject) => { getProcessTree(123, (tree) => { if (tree) { resolve(); } else { reject(new Error("windows-process-tree")); } }); });} : () => Promise<void> | |||
> : ^^^^^^^^^^^^^^^^^^^ | |||
>async () => { return new Promise((resolve, reject) => { getProcessTree(123, (tree) => { if (tree) { resolve(); } else { reject(new Error("windows-process-tree")); } }); });} : (this: Context) => Promise<void> |
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.
assigned this
parameter in an arrow isn't anything new, it can happen with other context-sensitive arguments with this signature: TS playground
src/compiler/checker.ts
Outdated
if (!node.typeArguments && checkMode & CheckMode.SkipContextSensitive && isContextSensitive(node)) { | ||
skippedGenericFunction(node, checkMode); | ||
return resolvingSignature; | ||
} |
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 PR is put together quickly - as an experiment. I didn't think through how those new codepaths that call skippedGenericFunction
and return resolvingSignature
might affect existing code.
The existing test suite doesn't immediately show this is a terrible idea though. It would be nice if an extended test suite could be ran for this experiment. cc @jakebailey
EDIT:// actually... the self-check fails here so it's probably not worth running the extended test suite at this point
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.
@jakebailey could you run tests here now? I kinda fully expect this PR to be garbage and break things but I'd like to get some test cases from the compiler usage in the wild that could be included in the in-repo test suite
self-check repro: TS playground |
@typescript-bot test it |
Hey @jakebailey, I've packed this into an installable tgz. You can install it for testing by referencing it in your
and then running There is also a playground for this build and an npm module you can use via |
Hey @jakebailey, the results of running the DT tests are ready. There were interesting changes: Branch only errors:Package: screeps
|
@jakebailey Here are the results of running the user tests with tsc comparing There were infrastructure failures potentially unrelated to your change:
Otherwise... Something interesting changed - please have a look. Details
|
@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 Something interesting changed - please have a look. Details
|
Repros:
|
fixes #62380