We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cd64f2b commit 1085e39Copy full SHA for 1085e39
1 file changed
src/compiler/checker.ts
@@ -6442,6 +6442,11 @@ namespace ts {
6442
// Return the contextual type for a given expression node. During overload resolution, a contextual type may temporarily
6443
// be "pushed" onto a node using the contextualType property.
6444
function getContextualType(node: Expression): Type {
6445
+ let type = getContextualTypeWorker(node);
6446
+ return type && getApparentType(type);
6447
+ }
6448
+
6449
+ function getContextualTypeWorker(node: Expression): Type {
6450
if (isInsideWithStatementBody(node)) {
6451
// We cannot answer semantic questions within a with block, do not proceed any further
6452
return undefined;
0 commit comments