Report error for invalid 'this' type during 'await' - #48946
Conversation
bce92ab to
0b6ad03
Compare
Nathan Shively-Sanders (sandersn)
left a comment
There was a problem hiding this comment.
Looks good, although I would personally collapse the two error parameters into one since they seem to be mutually exclusive.
| * @remarks The "promised type" of a type is the type of the "value" parameter of the "onfulfilled" callback. | ||
| */ | ||
| function getPromisedTypeOfPromise(type: Type, errorNode?: Node): Type | undefined { | ||
| function getPromisedTypeOfPromise(type: Type, errorNode?: Node, thisTypeForErrorOut?: { value?: Type }): Type | undefined { |
There was a problem hiding this comment.
Probably should be a union since you don't want to issue the error twice, and the only place thisTypeForErrorOut is added did not previously pass errorNode.
There was a problem hiding this comment.
I don't want to have to test whether errorNode is a Node and I'd also rather not allocate a nursery object for { errorNode } if I don't have to.
|
Daniel Rosenwasser (@DanielRosenwasser) worth taking for 4.7? If so I can merge now. |
|
TypeScript Bot (@typescript-bot) test this |
|
Heya Ron Buckton (@rbuckton), I've started to run the parallelized community code test suite on this PR at 0b6ad03. You can monitor the build here. |
|
Heya Ron Buckton (@rbuckton), I've started to run the extended test suite on this PR at 0b6ad03. You can monitor the build here. |
|
TypeScript Bot (@typescript-bot) user test this inline |
|
Heya Daniel Rosenwasser (@DanielRosenwasser), I've started to run the diff-based community code test suite on this PR at 0b6ad03. You can monitor the build here. Update: The results are in! |
|
Heya Daniel Rosenwasser (@DanielRosenwasser), I've started to run the abridged perf test suite on this PR at 0b6ad03. You can monitor the build here. Update: The results are in! |
|
Daniel Rosenwasser (@DanielRosenwasser) Here they are:Comparison Report - main..48946
System
Hosts
Scenarios
Developer Information: |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Daniel Rosenwasser (@DanielRosenwasser) |
|
The user suite test run you requested has finished and failed. I've opened a PR with the baseline diff from master. |
Fixes #47711