Skip to content

Commit 3fe7591

Browse files
committed
Accepting new baselines
1 parent 11aecee commit 3fe7591

File tree

44 files changed

+348
-1262
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+348
-1262
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
tests/cases/compiler/arrayCast.ts(3,1): error TS2352: Neither type '{ foo: string; }[]' nor type '{ id: number; }[]' is assignable to the other.
22
Type '{ foo: string; }' is not assignable to type '{ id: number; }'.
3-
Property 'id' is missing in type '{ foo: string; }'.
3+
Property 'foo' does not exist on type '{ id: number; }'.
44

55

66
==== tests/cases/compiler/arrayCast.ts (1 errors) ====
@@ -10,7 +10,7 @@ tests/cases/compiler/arrayCast.ts(3,1): error TS2352: Neither type '{ foo: strin
1010
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1111
!!! error TS2352: Neither type '{ foo: string; }[]' nor type '{ id: number; }[]' is assignable to the other.
1212
!!! error TS2352: Type '{ foo: string; }' is not assignable to type '{ id: number; }'.
13-
!!! error TS2352: Property 'id' is missing in type '{ foo: string; }'.
13+
!!! error TS2352: Property 'foo' does not exist on type '{ id: number; }'.
1414

1515
// Should succeed, as the {} element causes the type of the array to be {}[]
1616
<{ id: number; }[]>[{ foo: "s" }, {}];
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
tests/cases/compiler/arrayLiteralTypeInference.ts(13,5): error TS2322: Type '({ id: number; trueness: boolean; } | { id: number; name: string; })[]' is not assignable to type 'Action[]'.
2+
Type '{ id: number; trueness: boolean; } | { id: number; name: string; }' is not assignable to type 'Action'.
3+
Type '{ id: number; trueness: boolean; }' is not assignable to type 'Action'.
4+
Property 'trueness' does not exist on type 'Action'.
5+
tests/cases/compiler/arrayLiteralTypeInference.ts(29,5): error TS2322: Type '({ id: number; trueness: boolean; } | { id: number; name: string; })[]' is not assignable to type '{ id: number; }[]'.
6+
Type '{ id: number; trueness: boolean; } | { id: number; name: string; }' is not assignable to type '{ id: number; }'.
7+
Type '{ id: number; trueness: boolean; }' is not assignable to type '{ id: number; }'.
8+
Property 'trueness' does not exist on type '{ id: number; }'.
9+
10+
11+
==== tests/cases/compiler/arrayLiteralTypeInference.ts (2 errors) ====
12+
class Action {
13+
id: number;
14+
}
15+
16+
class ActionA extends Action {
17+
value: string;
18+
}
19+
20+
class ActionB extends Action {
21+
trueNess: boolean;
22+
}
23+
24+
var x1: Action[] = [
25+
~~
26+
!!! error TS2322: Type '({ id: number; trueness: boolean; } | { id: number; name: string; })[]' is not assignable to type 'Action[]'.
27+
!!! error TS2322: Type '{ id: number; trueness: boolean; } | { id: number; name: string; }' is not assignable to type 'Action'.
28+
!!! error TS2322: Type '{ id: number; trueness: boolean; }' is not assignable to type 'Action'.
29+
!!! error TS2322: Property 'trueness' does not exist on type 'Action'.
30+
{ id: 2, trueness: false },
31+
{ id: 3, name: "three" }
32+
]
33+
34+
var x2: Action[] = [
35+
new ActionA(),
36+
new ActionB()
37+
]
38+
39+
var x3: Action[] = [
40+
new Action(),
41+
new ActionA(),
42+
new ActionB()
43+
]
44+
45+
var z1: { id: number }[] =
46+
~~
47+
!!! error TS2322: Type '({ id: number; trueness: boolean; } | { id: number; name: string; })[]' is not assignable to type '{ id: number; }[]'.
48+
!!! error TS2322: Type '{ id: number; trueness: boolean; } | { id: number; name: string; }' is not assignable to type '{ id: number; }'.
49+
!!! error TS2322: Type '{ id: number; trueness: boolean; }' is not assignable to type '{ id: number; }'.
50+
!!! error TS2322: Property 'trueness' does not exist on type '{ id: number; }'.
51+
[
52+
{ id: 2, trueness: false },
53+
{ id: 3, name: "three" }
54+
]
55+
56+
var z2: { id: number }[] =
57+
[
58+
new ActionA(),
59+
new ActionB()
60+
]
61+
62+
var z3: { id: number }[] =
63+
[
64+
new Action(),
65+
new ActionA(),
66+
new ActionB()
67+
]
68+
69+
70+
71+
72+

tests/baselines/reference/arrayLiteralTypeInference.symbols

Lines changed: 0 additions & 113 deletions
This file was deleted.

tests/baselines/reference/arrayLiteralTypeInference.types

Lines changed: 0 additions & 144 deletions
This file was deleted.

0 commit comments

Comments
 (0)