From 6535809cc771d7f62d64c5ef758b58217b32135e 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 1e332254502..9db3dff8329 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -11496,7 +11496,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; }