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
Use found thisParameter #30596
Use found thisParameter #30596
Conversation
// TODO: GH#18217 We tested that *some* has thisParameter and now act as if *all* do | ||
const thisType = getUnionType(map(unionSignatures, sig => sig.thisParameter ? getTypeOfSymbol(sig.thisParameter) : anyType), UnionReduction.Subtype); | ||
thisParameter = createSymbolWithType(signature.thisParameter!, thisType); | ||
thisParameter = createSymbolWithType(thisParameter, thisType); |
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.
We definitely need test for this. The best way to get that would be to run tsc in debug mode without fix and figure out which type in your code base was resulting in the crash and get those signatures to make the union type.
Note that seems like your want union of signatures in which first signature doesn't have this parameter.
@sheetalkamat Sorry for not getting back on this sooner. I assume there's no benefit to exploring exactly what the problem was in the earlier version. |
@XuluWarrior can you still reproduce this? If so, @sheetalkamat's advice to debug tsc.js in-place is the best idea for finding the source of the problem and producing an independent repro. If not, let me know and I will close this. |
This is a speculative, letter-box fix for #29884
I hope that somebody that understands the code more can advise whether the fix is appropriate.
Fixes #29884