Change "object type literal" to "type literal"
This commit is contained in:
parent
e363c7582b
commit
144d24c2cb
4 changed files with 8 additions and 8 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
},
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
|
@ -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.
|
||||
};
|
||||
|
Loading…
Reference in a new issue