diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 300b3d74295..ea704ed3382 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -14283,7 +14283,7 @@ namespace ts { case SyntaxKind.ThisKeyword: case SyntaxKind.SuperKeyword: - let type = checkExpression(node); + let type = isExpression(node) ? checkExpression(node) : getTypeFromTypeNode(node); return type.symbol; case SyntaxKind.ConstructorKeyword: diff --git a/src/services/services.ts b/src/services/services.ts index eb81a336736..d078571e5a8 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -6249,7 +6249,8 @@ namespace ts { } return node.parent.kind === SyntaxKind.TypeReference || - (node.parent.kind === SyntaxKind.ExpressionWithTypeArguments && !isExpressionWithTypeArgumentsInClassExtendsClause(node.parent)); + (node.parent.kind === SyntaxKind.ExpressionWithTypeArguments && !isExpressionWithTypeArgumentsInClassExtendsClause(node.parent)) || + node.kind === SyntaxKind.ThisKeyword && !isExpression(node); } function isNamespaceReference(node: Node): boolean {