Checking references skips assertions+parentheses

This commit is contained in:
Nathan Shively-Sanders committed 2017-06-12 14:40:01 -07:00
1 parent 13b7d17da7
commit 55beb14bca
1 file changed
+1 -1
+1 -1
View File
@@ -16880,7 +16880,7 @@ namespace ts {
function checkReferenceExpression(expr: Expression, invalidReferenceMessage: DiagnosticMessage): boolean {
// References are combinations of identifiers, parentheses, and property accesses.
const node = skipParentheses(expr);
const node = skipOuterExpressions(expr, OuterExpressionKinds.Assertions | OuterExpressionKinds.Parentheses);
if (node.kind !== SyntaxKind.Identifier && node.kind !== SyntaxKind.PropertyAccessExpression && node.kind !== SyntaxKind.ElementAccessExpression) {
error(expr, invalidReferenceMessage);
return false;