Skip to content

Commit 144d24c

Browse files
committed
Change "object type literal" to "type literal"
1 parent e363c75 commit 144d24c

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

src/compiler/checker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16236,7 +16236,7 @@ namespace ts {
1623616236
return true;
1623716237
}
1623816238
if (node.initializer) {
16239-
return grammarErrorOnNode(node.initializer, Diagnostics.An_object_type_literal_property_cannot_have_an_initializer);
16239+
return grammarErrorOnNode(node.initializer, Diagnostics.A_type_literal_property_cannot_have_an_initializer);
1624016240
}
1624116241
}
1624216242

src/compiler/diagnosticMessages.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,7 @@
787787
"category": "Error",
788788
"code": 1246
789789
},
790-
"An object type literal property cannot have an initializer.": {
790+
"A type literal property cannot have an initializer.": {
791791
"category": "Error",
792792
"code": 1247
793793
},

src/compiler/parser.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2249,9 +2249,9 @@ namespace ts {
22492249
property.type = parseTypeAnnotation();
22502250

22512251
if (token === SyntaxKind.EqualsToken) {
2252-
// Although object type properties cannot not have initializers, we attempt
2252+
// Although type literal properties cannot not have initializers, we attempt
22532253
// to parse an initializer so we can report in the checker that an interface
2254-
// property or object type literal property cannot have an initializer.
2254+
// property or type literal property cannot have an initializer.
22552255
property.initializer = parseNonParameterInitializer();
22562256
}
22572257

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
tests/cases/compiler/errorOnInitializerInObjectTypeLiteralProperty.ts(2,19): error TS1247: An object type literal property cannot have an initializer.
2-
tests/cases/compiler/errorOnInitializerInObjectTypeLiteralProperty.ts(6,19): error TS1247: An object type literal property cannot have an initializer.
1+
tests/cases/compiler/errorOnInitializerInObjectTypeLiteralProperty.ts(2,19): error TS1247: A type literal property cannot have an initializer.
2+
tests/cases/compiler/errorOnInitializerInObjectTypeLiteralProperty.ts(6,19): error TS1247: A type literal property cannot have an initializer.
33

44

55
==== tests/cases/compiler/errorOnInitializerInObjectTypeLiteralProperty.ts (2 errors) ====
66
var Foo: {
77
bar: number = 5;
88
~
9-
!!! error TS1247: An object type literal property cannot have an initializer.
9+
!!! error TS1247: A type literal property cannot have an initializer.
1010
};
1111

1212
let Bar: {
1313
bar: number = 5;
1414
~
15-
!!! error TS1247: An object type literal property cannot have an initializer.
15+
!!! error TS1247: A type literal property cannot have an initializer.
1616
};
1717

0 commit comments

Comments
 (0)