diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index cc661ec869c..ac0ec995d79 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -8517,7 +8517,7 @@ namespace ts { } else if (isIdentifierTypePredicate(target.typePredicate)) { if (reportErrors) { - errorReporter(Diagnostics.Signature_0_must_have_a_type_predicate, signatureToString(source)); + errorReporter(Diagnostics.Signature_0_must_be_a_type_predicate, signatureToString(source)); } return Ternary.False; } diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index c5c90dc6278..1fd434abf4c 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -707,7 +707,7 @@ "category": "Error", "code": 1223 }, - "Signature '{0}' must have a type predicate.": { + "Signature '{0}' must be a type predicate.": { "category": "Error", "code": 1224 }, @@ -3637,7 +3637,7 @@ "category": "Message", "code": 90025 }, - + "Convert function to an ES2015 class": { "category": "Message", "code": 95001 diff --git a/tests/baselines/reference/typeGuardFunctionErrors.errors.txt b/tests/baselines/reference/typeGuardFunctionErrors.errors.txt index b9d884939bd..63442a93b6b 100644 --- a/tests/baselines/reference/typeGuardFunctionErrors.errors.txt +++ b/tests/baselines/reference/typeGuardFunctionErrors.errors.txt @@ -27,7 +27,7 @@ tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(74,46) Type 'C' is not assignable to type 'B'. Property 'propB' is missing in type 'C'. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(78,1): error TS2322: Type '(p1: any, p2: any) => boolean' is not assignable to type '(p1: any, p2: any) => p1 is A'. - Signature '(p1: any, p2: any): boolean' must have a type predicate. + Signature '(p1: any, p2: any): boolean' must be a type predicate. tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(84,1): error TS2322: Type '(p1: any, p2: any) => p2 is A' is not assignable to type '(p1: any, p2: any) => p1 is A'. Type predicate 'p2 is A' is not assignable to 'p1 is A'. Parameter 'p2' is not in the same position as parameter 'p1'. @@ -194,7 +194,7 @@ tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(136,39 assign1 = function(p1, p2): boolean { ~~~~~~~ !!! error TS2322: Type '(p1: any, p2: any) => boolean' is not assignable to type '(p1: any, p2: any) => p1 is A'. -!!! error TS2322: Signature '(p1: any, p2: any): boolean' must have a type predicate. +!!! error TS2322: Signature '(p1: any, p2: any): boolean' must be a type predicate. return true; };