You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tests/baselines/reference/objectLiteralExcessProperties.errors.txt
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
tests/cases/compiler/objectLiteralExcessProperties.ts(9,18): error TS2322: Type '{ forword: string; }' is not assignable to type 'Book'.
2
-
Object literal may only specify known properties, and 'forword' does not exist in type 'Book'.
2
+
Object literal may only specify known properties, but 'forword' does not exist in type 'Book'. Did you mean to write 'foreword'?
3
3
tests/cases/compiler/objectLiteralExcessProperties.ts(11,27): error TS2322: Type '{ foreward: string; }' is not assignable to type 'string | Book'.
4
4
Object literal may only specify known properties, and 'foreward' does not exist in type 'string | Book'.
5
5
tests/cases/compiler/objectLiteralExcessProperties.ts(13,53): error TS2322: Type '({ foreword: string; } | { forwards: string; })[]' is not assignable to type 'Book | Book[]'.
@@ -8,9 +8,9 @@ tests/cases/compiler/objectLiteralExcessProperties.ts(13,53): error TS2322: Type
8
8
Type '{ forwards: string; }' is not assignable to type 'Book'.
9
9
Object literal may only specify known properties, and 'forwards' does not exist in type 'Book'.
10
10
tests/cases/compiler/objectLiteralExcessProperties.ts(15,42): error TS2322: Type '{ foreword: string; colour: string; }' is not assignable to type 'Book & Cover'.
11
-
Object literal may only specify known properties, and 'colour' does not exist in type 'Book & Cover'.
11
+
Object literal may only specify known properties, but 'colour' does not exist in type 'Book & Cover'. Did you mean to write 'color'?
12
12
tests/cases/compiler/objectLiteralExcessProperties.ts(17,26): error TS2322: Type '{ foreward: string; color: string; }' is not assignable to type 'Book & Cover'.
13
-
Object literal may only specify known properties, and 'foreward' does not exist in type 'Book & Cover'.
13
+
Object literal may only specify known properties, but 'foreward' does not exist in type 'Book & Cover'. Did you mean to write 'foreword'?
14
14
tests/cases/compiler/objectLiteralExcessProperties.ts(19,57): error TS2322: Type '{ foreword: string; color: string; price: number; }' is not assignable to type 'Book & Cover'.
15
15
Object literal may only specify known properties, and 'price' does not exist in type 'Book & Cover'.
16
16
tests/cases/compiler/objectLiteralExcessProperties.ts(21,43): error TS2322: Type '{ foreword: string; price: number; }' is not assignable to type 'Book & number'.
@@ -22,7 +22,7 @@ tests/cases/compiler/objectLiteralExcessProperties.ts(25,27): error TS2322: Type
22
22
tests/cases/compiler/objectLiteralExcessProperties.ts(33,27): error TS2322: Type '{ 0: { colour: string; }; }' is not assignable to type 'Indexed'.
23
23
Property '0' is incompatible with index signature.
24
24
Type '{ colour: string; }' is not assignable to type 'Cover'.
25
-
Object literal may only specify known properties, and 'colour' does not exist in type 'Cover'.
25
+
Object literal may only specify known properties, but 'colour' does not exist in type 'Cover'. Did you mean to write 'color'?
@@ -37,7 +37,7 @@ tests/cases/compiler/objectLiteralExcessProperties.ts(33,27): error TS2322: Type
37
37
var b1: Book = { forword: "oops" };
38
38
~~~~~~~~~~~~~~~
39
39
!!! error TS2322: Type '{ forword: string; }' is not assignable to type 'Book'.
40
-
!!! error TS2322: Object literal may only specify known properties, and 'forword' does not exist in type 'Book'.
40
+
!!! error TS2322: Object literal may only specify known properties, but 'forword' does not exist in type 'Book'. Did you mean to write 'foreword'?
41
41
42
42
var b2: Book | string = { foreward: "nope" };
43
43
~~~~~~~~~~~~~~~~
@@ -55,12 +55,12 @@ tests/cases/compiler/objectLiteralExcessProperties.ts(33,27): error TS2322: Type
55
55
var b4: Book & Cover = { foreword: "hi", colour: "blue" };
56
56
~~~~~~~~~~~~~~
57
57
!!! error TS2322: Type '{ foreword: string; colour: string; }' is not assignable to type 'Book & Cover'.
58
-
!!! error TS2322: Object literal may only specify known properties, and 'colour' does not exist in type 'Book & Cover'.
58
+
!!! error TS2322: Object literal may only specify known properties, but 'colour' does not exist in type 'Book & Cover'. Did you mean to write 'color'?
59
59
60
60
var b5: Book & Cover = { foreward: "hi", color: "blue" };
61
61
~~~~~~~~~~~~~~
62
62
!!! error TS2322: Type '{ foreward: string; color: string; }' is not assignable to type 'Book & Cover'.
63
-
!!! error TS2322: Object literal may only specify known properties, and 'foreward' does not exist in type 'Book & Cover'.
63
+
!!! error TS2322: Object literal may only specify known properties, but 'foreward' does not exist in type 'Book & Cover'. Did you mean to write 'foreword'?
64
64
65
65
var b6: Book & Cover = { foreword: "hi", color: "blue", price: 10.99 };
66
66
~~~~~~~~~~~~
@@ -93,5 +93,5 @@ tests/cases/compiler/objectLiteralExcessProperties.ts(33,27): error TS2322: Type
93
93
!!! error TS2322: Type '{ 0: { colour: string; }; }' is not assignable to type 'Indexed'.
94
94
!!! error TS2322: Property '0' is incompatible with index signature.
95
95
!!! error TS2322: Type '{ colour: string; }' is not assignable to type 'Cover'.
96
-
!!! error TS2322: Object literal may only specify known properties, and 'colour' does not exist in type 'Cover'.
96
+
!!! error TS2322: Object literal may only specify known properties, but 'colour' does not exist in type 'Cover'. Did you mean to write 'color'?
tests/cases/compiler/spellingSuggestionLeadingUnderscores01.ts(6,3): error TS2551: Property '___foo' does not exist on type '{ __foo: 10; }'. Did you mean '__foo'?
2
+
tests/cases/compiler/spellingSuggestionLeadingUnderscores01.ts(14,5): error TS2322: Type '{ ___foo: number; }' is not assignable to type '{ __foo: number; }'.
3
+
Object literal may only specify known properties, but '___foo' does not exist in type '{ __foo: number; }'. Did you mean to write '__foo'?
!!! error TS2551: Property '___foo' does not exist on type '{ __foo: 10; }'. Did you mean '__foo'?
15
+
16
+
// @filename def.ts
17
+
export let b: {
18
+
__foo: number
19
+
}
20
+
21
+
b = {
22
+
___foo: 100,
23
+
~~~~~~~~~~~
24
+
!!! error TS2322: Type '{ ___foo: number; }' is not assignable to type '{ __foo: number; }'.
25
+
!!! error TS2322: Object literal may only specify known properties, but '___foo' does not exist in type '{ __foo: number; }'. Did you mean to write '__foo'?
0 commit comments