File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -4632,6 +4632,9 @@ namespace ts {
4632
4632
4633
4633
function getThisTypeOfSignature(signature: Signature): Type | undefined {
4634
4634
if (signature.thisParameter) {
4635
+ if (signature.mapper) {
4636
+ signature = instantiateSignature(signature, signature.mapper);
4637
+ }
4635
4638
return getTypeOfSymbol(signature.thisParameter);
4636
4639
}
4637
4640
}
@@ -11770,6 +11773,10 @@ namespace ts {
11770
11773
11771
11774
function assignContextualParameterTypes(signature: Signature, context: Signature, mapper: TypeMapper) {
11772
11775
const len = signature.parameters.length - (signature.hasRestParameter ? 1 : 0);
11776
+ if (context.thisParameter) {
11777
+ // save the mapper in case we need to type `this` later
11778
+ context.mapper = mapper;
11779
+ }
11773
11780
for (let i = 0; i < len; i++) {
11774
11781
const parameter = signature.parameters[i];
11775
11782
const contextualParameterType = getTypeAtPosition(context, i);
You can’t perform that action at this time.
0 commit comments