Merge pull request #1648 from Microsoft/contextualTypeParenthesizedExpressions

Contextually type parenthesized expressions
This commit is contained in:
Daniel Rosenwasser
2015-01-14 14:52:07 -08:00
18 changed files with 1146 additions and 40 deletions
+4
View File
@@ -3337,6 +3337,8 @@ module ts {
case SyntaxKind.MethodDeclaration:
case SyntaxKind.MethodSignature:
return isContextSensitiveFunctionLikeDeclaration(<MethodDeclaration>node);
case SyntaxKind.ParenthesizedExpression:
return isContextSensitive((<ParenthesizedExpression>node).expression);
}
return false;
@@ -5229,6 +5231,8 @@ module ts {
case SyntaxKind.TemplateSpan:
Debug.assert(parent.parent.kind === SyntaxKind.TemplateExpression);
return getContextualTypeForSubstitutionExpression(<TemplateExpression>parent.parent, node);
case SyntaxKind.ParenthesizedExpression:
return getContextualType(<ParenthesizedExpression>parent);
}
return undefined;
}