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
Put error spans deep on nested object literals (microsoft#25140)
* Add ncie deep elaborations
* Nice stuff
* Modify tuple error to use length error mroe often
* Accept good baselines
* Accept meh baselines
* Fix literal types
* Calculate elaborations like it was the very first time again~
* Use tristate for enum relationship to ensure elaborations are printed at least once
* Update message text, nits
* move some functions back to where they were
* Add test of deep JSX elaboration
* Add elaboration test with parenthesized expressions, comma expressions, and assignments
* Move check to allow elaborations on more anonymous types
* Fix nits
* Add specialized error to elaborations of nonliteral computed named-members
* Update error message
Copy file name to clipboardExpand all lines: tests/baselines/reference/arrayLiterals3.errors.txt
+10-6
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,8 @@
1
1
tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(10,5): error TS2322: Type '[]' is not assignable to type '[any, any, any]'.
2
2
Property '0' is missing in type '[]'.
3
-
tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(11,5): error TS2322: Type '[string, number, boolean]' is not assignable to type '[boolean, string, number]'.
4
-
Type 'string' is not assignable to type 'boolean'.
3
+
tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(11,38): error TS2322: Type 'string' is not assignable to type 'boolean'.
4
+
tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(11,48): error TS2322: Type 'number' is not assignable to type 'string'.
5
+
tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(11,51): error TS2322: Type 'true' is not assignable to type 'number'.
5
6
tests/cases/conformance/expressions/arrayLiterals/arrayLiterals3.ts(17,5): error TS2322: Type '[number, number, string, boolean]' is not assignable to type '[number, number]'.
tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(17,1): error TS2539: Cannot assign to 'M' because it is not a variable.
7
7
tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(18,2): error TS2539: Cannot assign to 'M' because it is not a variable.
8
8
tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(25,5): error TS2539: Cannot assign to 'M3' because it is not a variable.
9
-
tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(31,1): error TS2322: Type '{ x: string; }' is not assignable to type 'typeof M3'.
10
-
Types of property 'x' are incompatible.
11
-
Type 'string' is not assignable to type 'number'.
12
-
tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(32,1): error TS2322: Type '{ x: string; }' is not assignable to type 'typeof M3'.
13
-
Types of property 'x' are incompatible.
14
-
Type 'string' is not assignable to type 'number'.
15
-
tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(33,1): error TS2322: Type '{ x: string; }' is not assignable to type 'typeof M3'.
16
-
Types of property 'x' are incompatible.
17
-
Type 'string' is not assignable to type 'number'.
9
+
tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(31,11): error TS2322: Type 'string' is not assignable to type 'number'.
10
+
tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(32,13): error TS2322: Type 'string' is not assignable to type 'number'.
11
+
tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(33,13): error TS2322: Type 'string' is not assignable to type 'number'.
18
12
tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(37,1): error TS2539: Cannot assign to 'fn' because it is not a variable.
19
13
tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(38,2): error TS2539: Cannot assign to 'fn' because it is not a variable.
20
14
tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts(43,5): error TS2322: Type '""' is not assignable to type 'number'.
!!! error TS2322: Type '{ x: string; }' is not assignable to type 'typeof M3'.
83
-
!!! error TS2322: Types of property 'x' are incompatible.
84
-
!!! error TS2322: Type 'string' is not assignable to type 'number'.
75
+
~
76
+
!!! error TS2322: Type 'string' is not assignable to type 'number'.
77
+
!!! related TS6500 tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts:22:20: The expected type comes from property 'x' which is declared here on type 'typeof M3'
85
78
(M2).M3 = { x: '' }; // Error
86
-
~~~~~~~
87
-
!!! error TS2322: Type '{ x: string; }' is not assignable to type 'typeof M3'.
88
-
!!! error TS2322: Types of property 'x' are incompatible.
89
-
!!! error TS2322: Type 'string' is not assignable to type 'number'.
79
+
~
80
+
!!! error TS2322: Type 'string' is not assignable to type 'number'.
81
+
!!! related TS6500 tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts:22:20: The expected type comes from property 'x' which is declared here on type 'typeof M3'
90
82
(M2.M3) = { x: '' }; // Error
91
-
~~~~~~~
92
-
!!! error TS2322: Type '{ x: string; }' is not assignable to type 'typeof M3'.
93
-
!!! error TS2322: Types of property 'x' are incompatible.
94
-
!!! error TS2322: Type 'string' is not assignable to type 'number'.
83
+
~
84
+
!!! error TS2322: Type 'string' is not assignable to type 'number'.
85
+
!!! related TS6500 tests/cases/conformance/expressions/valuesAndReferences/assignmentToParenthesizedIdentifiers.ts:22:20: The expected type comes from property 'x' which is declared here on type 'typeof M3'
Type 'string | Derived' is not assignable to type 'string | Base'.
7
7
Type 'Derived' is not assignable to type 'string | Base'.
8
-
Type 'Derived' is not assignable to type 'Base'.
9
8
tests/cases/compiler/baseClassImprovedMismatchErrors.ts(9,5): error TS2416: Property 'fn' in type 'Derived' is not assignable to the same property in base type 'Base'.
10
9
Type '() => string | number' is not assignable to type '() => number'.
11
10
Type 'string | number' is not assignable to type 'number'.
@@ -17,7 +16,6 @@ tests/cases/compiler/baseClassImprovedMismatchErrors.ts(14,5): error TS2416: Pro
17
16
Types of property 'n' are incompatible.
18
17
Type 'string | DerivedInterface' is not assignable to type 'string | Base'.
19
18
Type 'DerivedInterface' is not assignable to type 'string | Base'.
20
-
Type 'DerivedInterface' is not assignable to type 'Base'.
21
19
tests/cases/compiler/baseClassImprovedMismatchErrors.ts(15,5): error TS2416: Property 'fn' in type 'DerivedInterface' is not assignable to the same property in base type 'Base'.
22
20
Type '() => string | number' is not assignable to type '() => number'.
23
21
Type 'string | number' is not assignable to type 'number'.
@@ -41,7 +39,6 @@ tests/cases/compiler/baseClassImprovedMismatchErrors.ts(15,5): error TS2416: Pro
41
39
!!! error TS2416: Types of property 'n' are incompatible.
42
40
!!! error TS2416: Type 'string | Derived' is not assignable to type 'string | Base'.
43
41
!!! error TS2416: Type 'Derived' is not assignable to type 'string | Base'.
44
-
!!! error TS2416: Type 'Derived' is not assignable to type 'Base'.
45
42
fn() {
46
43
~~
47
44
!!! error TS2416: Property 'fn' in type 'Derived' is not assignable to the same property in base type 'Base'.
@@ -61,7 +58,6 @@ tests/cases/compiler/baseClassImprovedMismatchErrors.ts(15,5): error TS2416: Pro
61
58
!!! error TS2416: Types of property 'n' are incompatible.
62
59
!!! error TS2416: Type 'string | DerivedInterface' is not assignable to type 'string | Base'.
63
60
!!! error TS2416: Type 'DerivedInterface' is not assignable to type 'string | Base'.
64
-
!!! error TS2416: Type 'DerivedInterface' is not assignable to type 'Base'.
65
61
fn() {
66
62
~~
67
63
!!! error TS2416: Property 'fn' in type 'DerivedInterface' is not assignable to the same property in base type 'Base'.
let b = <GenericComponent initialValues={12} nextValues={a => a} />; // No error - Values should be reinstantiated with `number` (since `object` is a default, not a constraint)
18
17
let c = <GenericComponent initialValues={{ x: "y" }} nextValues={a => ({ x: a.x })} />; // No Error
19
18
let d = <GenericComponent initialValues={{ x: "y" }} nextValues={a => a.x} />; // Error - `string` is not assignable to `{x: string}`
20
-
~~~~~~~~~~~~~~~~~~~~~
21
-
!!! error TS2326: Types of property 'nextValues' are incompatible.
22
-
!!! error TS2326: Type '(a: { x: string; }) => string' is not assignable to type '(cur: { x: string; }) => { x: string; }'.
23
-
!!! error TS2326: Type 'string' is not assignable to type '{ x: string; }'.
19
+
~~~~~~~~~~
20
+
!!! error TS2322: Type '(a: { x: string; }) => string' is not assignable to type '(cur: { x: string; }) => { x: string; }'.
21
+
!!! error TS2322: Type 'string' is not assignable to type '{ x: string; }'.
22
+
!!! related TS6500 tests/cases/conformance/jsx/file.tsx:13:54: The expected type comes from property 'nextValues' which is declared here on type 'IntrinsicAttributes & IntrinsicClassAttributes<GenericComponent<{ initialValues: { x: string; }; nextValues: {}; }, { x: string; }>> & { initialValues: { x: string; }; nextValues: {}; } & BaseProps<{ x: string; }> & { children?: ReactNode; }'
tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES5.ts(6,5): error TS2322: Type '{ [x: string]: string | number; }' is not assignable to type 'I'.
2
-
Index signatures are incompatible.
3
-
Type 'string | number' is not assignable to type 'boolean'.
4
-
Type 'string' is not assignable to type 'boolean'.
1
+
tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES5.ts(7,5): error TS2418: Type of computed property's value is 'string', which is not assignable to type 'boolean'.
2
+
tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES5.ts(8,5): error TS2418: Type of computed property's value is 'number', which is not assignable to type 'boolean'.
!!! error TS2322: Type '{ [x: string]: string | number; }' is not assignable to type 'I'.
16
-
!!! error TS2322: Index signatures are incompatible.
17
-
!!! error TS2322: Type 'string | number' is not assignable to type 'boolean'.
18
-
!!! error TS2322: Type 'string' is not assignable to type 'boolean'.
19
12
[""+"foo"]: "",
13
+
~~~~~~~~~~
14
+
!!! error TS2418: Type of computed property's value is 'string', which is not assignable to type 'boolean'.
15
+
!!! related TS6501 tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES5.ts:2:5: The expected type comes from this index signature.
20
16
[""+"bar"]: 0
17
+
~~~~~~~~~~
18
+
!!! error TS2418: Type of computed property's value is 'number', which is not assignable to type 'boolean'.
19
+
!!! related TS6501 tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES5.ts:2:5: The expected type comes from this index signature.
tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES6.ts(6,5): error TS2322: Type '{ [x: string]: string | number; }' is not assignable to type 'I'.
2
-
Index signatures are incompatible.
3
-
Type 'string | number' is not assignable to type 'boolean'.
4
-
Type 'string' is not assignable to type 'boolean'.
1
+
tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES6.ts(7,5): error TS2418: Type of computed property's value is 'string', which is not assignable to type 'boolean'.
2
+
tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES6.ts(8,5): error TS2418: Type of computed property's value is 'number', which is not assignable to type 'boolean'.
!!! error TS2322: Type '{ [x: string]: string | number; }' is not assignable to type 'I'.
16
-
!!! error TS2322: Index signatures are incompatible.
17
-
!!! error TS2322: Type 'string | number' is not assignable to type 'boolean'.
18
-
!!! error TS2322: Type 'string' is not assignable to type 'boolean'.
19
12
[""+"foo"]: "",
13
+
~~~~~~~~~~
14
+
!!! error TS2418: Type of computed property's value is 'string', which is not assignable to type 'boolean'.
15
+
!!! related TS6501 tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES6.ts:2:5: The expected type comes from this index signature.
20
16
[""+"bar"]: 0
17
+
~~~~~~~~~~
18
+
!!! error TS2418: Type of computed property's value is 'number', which is not assignable to type 'boolean'.
19
+
!!! related TS6501 tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType8_ES6.ts:2:5: The expected type comes from this index signature.
0 commit comments