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
* If that element would issue an error, we first attempt to dive into that element's inner expression and issue a more specific error by recuring into `elaborateError`
10613
10637
* Otherwise, we issue an error on _every_ element which fail the assignability check
10614
10638
*/
10615
-
function elaborateElementwise(iterator: ElaborationIterator, source: Type, target: Type) {
10639
+
function elaborateElementwise(iterator: ElaborationIterator, source: Type, target: Type, relation: Map<RelationComparisonResult>) {
10616
10640
// Assignability failure - check each prop individually, and if that fails, fall back on the bad error span
10617
10641
let reportedError = false;
10618
10642
for (let status = iterator.next(); !status.done; status = iterator.next()) {
tests/cases/compiler/didYouMeanElaborationsForExpressionsWhichCouldBeCalled.ts(10,8): error TS2322: Type 'typeof Bar' is not assignable to type 'Bar'.
2
+
Property 'x' is missing in type 'typeof Bar'.
3
+
tests/cases/compiler/didYouMeanElaborationsForExpressionsWhichCouldBeCalled.ts(11,8): error TS2322: Type 'DateConstructor' is not assignable to type 'Date'.
4
+
Property 'toDateString' is missing in type 'DateConstructor'.
5
+
tests/cases/compiler/didYouMeanElaborationsForExpressionsWhichCouldBeCalled.ts(17,4): error TS2322: Type '() => number' is not assignable to type 'number'.
6
+
tests/cases/compiler/didYouMeanElaborationsForExpressionsWhichCouldBeCalled.ts(26,5): error TS2322: Type '() => number' is not assignable to type 'number'.
declare function foo(arg: { x: Bar, y: Date }, item: number, items?: [number, number, number]): void;
17
+
18
+
foo({
19
+
x: Bar,
20
+
~~~
21
+
!!! error TS2322: Type 'typeof Bar' is not assignable to type 'Bar'.
22
+
!!! error TS2322: Property 'x' is missing in type 'typeof Bar'.
23
+
!!! related TS6213 tests/cases/compiler/didYouMeanElaborationsForExpressionsWhichCouldBeCalled.ts:10:8: Did you mean to use `new` with this expression?
24
+
y: Date
25
+
~~~~
26
+
!!! error TS2322: Type 'DateConstructor' is not assignable to type 'Date'.
27
+
!!! error TS2322: Property 'toDateString' is missing in type 'DateConstructor'.
28
+
!!! related TS6213 tests/cases/compiler/didYouMeanElaborationsForExpressionsWhichCouldBeCalled.ts:11:8: Did you mean to use `new` with this expression?
29
+
}, getNum());
30
+
31
+
foo({
32
+
x: new Bar(),
33
+
y: new Date()
34
+
}, getNum);
35
+
~~~~~~
36
+
!!! error TS2322: Type '() => number' is not assignable to type 'number'.
37
+
!!! related TS6212 tests/cases/compiler/didYouMeanElaborationsForExpressionsWhichCouldBeCalled.ts:17:4: Did you mean to call this expression?
38
+
39
+
40
+
foo({
41
+
x: new Bar(),
42
+
y: new Date()
43
+
}, getNum(), [
44
+
1,
45
+
2,
46
+
getNum
47
+
~~~~~~
48
+
!!! error TS2322: Type '() => number' is not assignable to type 'number'.
49
+
!!! related TS6212 tests/cases/compiler/didYouMeanElaborationsForExpressionsWhichCouldBeCalled.ts:26:5: Did you mean to call this expression?
0 commit comments