From b191a00b1c7fb2ce6c5adbb6213e808d446ce500 Mon Sep 17 00:00:00 2001 From: Daniel Rosenwasser Date: Thu, 28 Jan 2016 18:04:48 -0800 Subject: [PATCH] Actually, it makes more sense to error on the predicate annotation than anything else. --- src/compiler/checker.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 3ee1f2c6b72..dcaa5f97d78 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -11567,7 +11567,7 @@ namespace ts { const parent = getTypePredicateParent(node); if (!parent) { // The parent must not be valid. - error(node.parent, Diagnostics.A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods); + error(node, Diagnostics.A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods); return; }