Default contextual 'this' type is containing object literal

This commit is contained in:
Anders Hejlsberg 2017-02-16 17:04:30 -08:00
parent 8cd6c5d8eb
commit 2ca6164fea

View File

@ -11230,6 +11230,9 @@ namespace ts {
}
objectLiteral = <ObjectLiteralExpression>objectLiteral.parent.parent;
}
// There was no contextual ThisType<T> for the containing object literal, so the contextual type
// for 'this' is the type of the object literal itself.
return checkExpressionCached(containingLiteral);
}
}
return undefined;