From 144d24c2cb727b21ddcdfac0489a57a852cb2cae Mon Sep 17 00:00:00 2001 From: Nathan Yee Date: Mon, 30 Nov 2015 21:52:50 -0800 Subject: [PATCH] Change "object type literal" to "type literal" --- src/compiler/checker.ts | 2 +- src/compiler/diagnosticMessages.json | 2 +- src/compiler/parser.ts | 4 ++-- ...rorOnInitializerInObjectTypeLiteralProperty.errors.txt | 8 ++++---- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 50189b03406..6445f8b13de 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -16236,7 +16236,7 @@ namespace ts { return true; } if (node.initializer) { - return grammarErrorOnNode(node.initializer, Diagnostics.An_object_type_literal_property_cannot_have_an_initializer); + return grammarErrorOnNode(node.initializer, Diagnostics.A_type_literal_property_cannot_have_an_initializer); } } diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index e3ae2a6706c..cd2fa769536 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -787,7 +787,7 @@ "category": "Error", "code": 1246 }, - "An object type literal property cannot have an initializer.": { + "A type literal property cannot have an initializer.": { "category": "Error", "code": 1247 }, diff --git a/src/compiler/parser.ts b/src/compiler/parser.ts index f5261b62aec..f4ac49a6b6f 100644 --- a/src/compiler/parser.ts +++ b/src/compiler/parser.ts @@ -2249,9 +2249,9 @@ namespace ts { property.type = parseTypeAnnotation(); if (token === SyntaxKind.EqualsToken) { - // Although object type properties cannot not have initializers, we attempt + // Although type literal properties cannot not have initializers, we attempt // to parse an initializer so we can report in the checker that an interface - // property or object type literal property cannot have an initializer. + // property or type literal property cannot have an initializer. property.initializer = parseNonParameterInitializer(); } diff --git a/tests/baselines/reference/errorOnInitializerInObjectTypeLiteralProperty.errors.txt b/tests/baselines/reference/errorOnInitializerInObjectTypeLiteralProperty.errors.txt index d79cced45c7..f6d10b92b2d 100644 --- a/tests/baselines/reference/errorOnInitializerInObjectTypeLiteralProperty.errors.txt +++ b/tests/baselines/reference/errorOnInitializerInObjectTypeLiteralProperty.errors.txt @@ -1,17 +1,17 @@ -tests/cases/compiler/errorOnInitializerInObjectTypeLiteralProperty.ts(2,19): error TS1247: An object type literal property cannot have an initializer. -tests/cases/compiler/errorOnInitializerInObjectTypeLiteralProperty.ts(6,19): error TS1247: An object type literal property cannot have an initializer. +tests/cases/compiler/errorOnInitializerInObjectTypeLiteralProperty.ts(2,19): error TS1247: A type literal property cannot have an initializer. +tests/cases/compiler/errorOnInitializerInObjectTypeLiteralProperty.ts(6,19): error TS1247: A type literal property cannot have an initializer. ==== tests/cases/compiler/errorOnInitializerInObjectTypeLiteralProperty.ts (2 errors) ==== var Foo: { bar: number = 5; ~ -!!! error TS1247: An object type literal property cannot have an initializer. +!!! error TS1247: A type literal property cannot have an initializer. }; let Bar: { bar: number = 5; ~ -!!! error TS1247: An object type literal property cannot have an initializer. +!!! error TS1247: A type literal property cannot have an initializer. }; \ No newline at end of file