From a4ab192b6fb91b9277124e22e165f58ccb24c609 Mon Sep 17 00:00:00 2001 From: Sheetal Nandi Date: Thu, 4 Dec 2014 13:38:00 -0800 Subject: [PATCH] Fix the merge conflicts --- src/compiler/checker.ts | 3 ++- src/harness/typeWriter.ts | 2 +- .../callExpressionWithMissingTypeArgument1.errors.txt | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 9613faa658..5cd7154427 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -4395,7 +4395,8 @@ module ts { // That helps in making sure not assigning types as any when resolved out of order var containerNodes: Node[] = []; for (var parent = node.parent; parent; parent = parent.parent) { - if (isExpression(parent) && isContextSensitiveExpression(parent)) { + if ((isExpression(parent) || isObjectLiteralMethod(node)) && + isContextSensitive(parent)) { containerNodes.unshift(parent); } } diff --git a/src/harness/typeWriter.ts b/src/harness/typeWriter.ts index 11d2e62e10..44888059ff 100644 --- a/src/harness/typeWriter.ts +++ b/src/harness/typeWriter.ts @@ -94,7 +94,7 @@ class TypeWriterWalker { } private getTypeOfNode(node: ts.Node): ts.Type { - var type = this.checker.getTypeOfLocation(node); + var type = this.checker.getTypeAtLocation(node); ts.Debug.assert(type !== undefined, "type doesn't exist"); return type; } diff --git a/tests/baselines/reference/callExpressionWithMissingTypeArgument1.errors.txt b/tests/baselines/reference/callExpressionWithMissingTypeArgument1.errors.txt index 7d91abeaa6..c7005ffcc2 100644 --- a/tests/baselines/reference/callExpressionWithMissingTypeArgument1.errors.txt +++ b/tests/baselines/reference/callExpressionWithMissingTypeArgument1.errors.txt @@ -4,7 +4,7 @@ tests/cases/compiler/callExpressionWithMissingTypeArgument1.ts(1,1): error TS230 ==== tests/cases/compiler/callExpressionWithMissingTypeArgument1.ts (2 errors) ==== Foo(); - + ~ !!! error TS1110: Type expected. ~~~ !!! error TS2304: Cannot find name 'Foo'. \ No newline at end of file