Skip to content

Commit

Permalink
Fix 'this' parameter handling in getUnionSignatures
Browse files Browse the repository at this point in the history
  • Loading branch information
ahejlsberg committed Dec 20, 2017
1 parent 8173733 commit c78a6a5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5936,7 +5936,7 @@ namespace ts {
if (unionSignatures.length > 1) {
let thisParameter = signature.thisParameter;
if (forEach(unionSignatures, sig => sig.thisParameter)) {
const thisType = getUnionType(map(unionSignatures, sig => getTypeOfSymbol(sig.thisParameter) || anyType), UnionReduction.Subtype);
const thisType = getUnionType(map(unionSignatures, sig => sig.thisParameter ? getTypeOfSymbol(sig.thisParameter) : anyType), UnionReduction.Subtype);
thisParameter = createSymbolWithType(signature.thisParameter, thisType);
}
s = cloneSignature(signature);
Expand Down

0 comments on commit c78a6a5

Please sign in to comment.