8000 Baselines · microsoft/TypeScript@20359b9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 20359b9

Browse files
committed
Baselines
1 parent 668eb85 commit 20359b9

File tree

369 files changed

+5090
-9297
lines changed

Some content is hidden

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

369 files changed

+5090
-9297
lines changed
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
ES5For-of27.ts(1,11): error TS2339: Property 'x' does not exist on type 'Number'.
2-
ES5For-of27.ts(1,21): error TS2339: Property 'y' does not exist on type 'Number'.
1+
ES5For-of27.ts(1,11): error TS2339: Property 'x' does not exist on type 'number'.
2+
ES5For-of27.ts(1,21): error TS2339: Property 'y' does not exist on type 'number'.
33

44

55
==== ES5For-of27.ts (2 errors) ====
66
for (var {x: a = 0, y: b = 1} of [2, 3]) {
77
~
8-
!!! error TS2339: Property 'x' does not exist on type 'Number'.
8+
!!! error TS2339: Property 'x' does not exist on type 'number'.
99
~
10-
!!! error TS2339: Property 'y' does not exist on type 'Number'.
10+
!!! error TS2339: Property 'y' does not exist on type 'number'.
1111
a;
1212
b;
1313
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
ES5For-of29.ts(1,13): error TS2339: Property 'x' does not exist on type 'Number'.
2-
ES5For-of29.ts(1,23): error TS2339: Property 'y' does not exist on type 'Number'.
1+
ES5For-of29.ts(1,13): error TS2339: Property 'x' does not exist on type 'number'.
2+
ES5For-of29.ts(1,23): error TS2339: Property 'y' does not exist on type 'number'.
33

44

55
==== ES5For-of29.ts (2 errors) ====
66
for (const {x: a = 0, y: b = 1} of [2, 3]) {
77
~
8-
!!! error TS2339: Property 'x' does not exist on type 'Number'.
8+
!!! error TS2339: Property 'x' does not exist on type 'number'.
99
~
10-
!!! error TS2339: Property 'y' does not exist on type 'Number'.
10+
!!! error TS2339: Property 'y' does not exist on type 'number'.
1111
a;
1212
b;
1313
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
ES5For-of35.ts(1,13): error TS2339: Property 'x' does not exist on type 'Number'.
2-
ES5For-of35.ts(1,23): error TS2339: Property 'y' does not exist on type 'Number'.
1+
ES5For-of35.ts(1,13): error TS2339: Property 'x' does not exist on type 'number'.
2+
ES5For-of35.ts(1,23): error TS2339: Property 'y' does not exist on type 'number'.
33

44

55
==== ES5For-of35.ts (2 errors) ====
66
for (const {x: a = 0, y: b = 1} of [2, 3]) {
77
~
8-
!!! error TS2339: Property 'x' does not exist on type 'Number'.
8+
!!! error TS2339: Property 'x' does not exist on type 'number'.
99
~
10-
!!! error TS2339: Property 'y' does not exist on type 'Number'.
10+
!!! error TS2339: Property 'y' does not exist on type 'number'.
1111
a;
1212
b;
1313
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
ES5For-ofTypeCheck14.ts(2,17): error TS2802: Type 'Set<number>' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.
1+
ES5For-ofTypeCheck14.ts(2,17): error TS2461: Type 'Set<number>' is not an array type.
22

33

44
==== ES5For-ofTypeCheck14.ts (1 errors) ====
55
var union: string | Set<number>
66
for (const e of union) { }
77
~~~~~
8-
!!! error TS2802: Type 'Set<number>' can only be iterated through when using the '--downlevelIteration' flag or with a '--target' of 'es2015' or higher.
8+
!!! error TS2461: Type 'Set<number>' is not an array type.

tests/baselines/reference/accessorAccidentalCallDiagnostic.errors.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
accessorAccidentalCallDiagnostic.ts(6,14): error TS6234: This expression is not callable because it is a 'get' accessor. Did you mean to use it without '()'?
2-
Type 'Number' has no call signatures.
2+
Type 'number' has no call signatures.
33

44

55
==== accessorAccidentalCallDiagnostic.ts (1 errors) ====
@@ -11,6 +11,6 @@ accessorAccidentalCallDiagnostic.ts(6,14): error TS6234: This expression is not
1111
return x.property();
1212
~~~~~~~~
1313
!!! error TS6234: This expression is not callable because it is a 'get' accessor. Did you mean to use it without '()'?
14-
!!! error TS6234: Type 'Number' has no call signatures.
14+
!!! error TS6234: Type 'number' has no call signatures.
1515
}
1616

tests/baselines/reference/apparentTypeSubtyping.errors.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
apparentTypeSubtyping.ts(9,31): error TS2344: Type 'string' does not satisfy the constraint 'String'.
12
apparentTypeSubtyping.ts(10,5): error TS2416: Property 'x' in type 'Derived<U>' is not assignable to the same property in base type 'Base<string>'.
23
Type 'String' is not assignable to type 'string'.
34
'string' is a primitive, but 'String' is a wrapper object. Prefer using 'string' when possible.
45

56

6-
==== apparentTypeSubtyping.ts (1 errors) ====
7+
==== apparentTypeSubtyping.ts (2 errors) ====
78
// subtype checks use the apparent type of the target type
89
// S is a subtype of a type T, and T is a supertype of S, if one of the following is true, where S' denotes the apparent type (section 3.8.1) of S:
910

@@ -13,6 +14,8 @@ apparentTypeSubtyping.ts(10,5): error TS2416: Property 'x' in type 'Derived<U>'
1314

1415
// is String (S) a subtype of U extends String (T)? Would only be true if we used the apparent type of U (T)
1516
class Derived<U> extends Base<string> { // error
17+
~~~~~~
18+
!!! error TS2344: Type 'string' does not satisfy the constraint 'String'.
1619
x: String;
1720
~
1821
!!! error TS2416: Property 'x' in type 'Derived<U>' is not assignable to the same property in base type 'Base<string>'.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
argumentsSpreadRestIterables.tsx(8,21): error TS2488: Type '"hello"' must have a '[Symbol.iterator]()' method that returns an iterator.
2+
argumentsSpreadRestIterables.tsx(10,27): error TS2488: Type '"hello"' must have a '[Symbol.iterator]()' method that returns an iterator.
3+
argumentsSpreadRestIterables.tsx(15,19): error TS2488: Type '"hello"' must have a '[Symbol.iterator]()' method that returns an iterator.
4+
argumentsSpreadRestIterables.tsx(17,25): error TS2488: Type '"hello"' must have a '[Symbol.iterator]()' method that returns an iterator.
5+
6+
7+
==== argumentsSpreadRestIterables.tsx (4 errors) ====
8+
declare const itNum: Iterable<number>
9+
10+
;(function(...rest) {})(...itNum)
11+
;(function(a, ...rest) {})('', ...itNum)
12+
;(function(a, ...rest) {})('', true, ...itNum)
13+
14+
declare function fn1<const T extends readonly unknown[]>(...args: T): T;
15+
const res1 = fn1(..."hello");
16+
~~~~~~~
17+
!!! error TS2488: Type '"hello"' must have a '[Symbol.iterator]()' method that returns an iterator.
18+
const res2 = fn1(...itNum);
19+
const res3 = fn1(true, ..."hello");
20+
~~~~~~~
21+
!!! error TS2488: Type '"hello"' must have a '[Symbol.iterator]()' method that returns an iterator.
22+
const res4 = fn1(true, ...itNum);
23+
24+
// repro from #52781
25+
declare function foo<T extends unknown[]>(...args: T): T;
26+
const p1 = foo(..."hello");
27+
~~~~~~~
28+
!!! error TS2488: Type '"hello"' must have a '[Symbol.iterator]()' method that returns an iterator.
29+
const p2 = foo(...itNum);
30+
const p3 = foo(true, ..."hello");
31+
~~~~~~~
32+
!!! error TS2488: Type '"hello"' must have a '[Symbol.iterator]()' method that returns an iterator.
33+
const p4 = foo(true, ...itNum);
34+

tests/baselines/reference/argumentsSpreadRestIterables(target=esnext).types

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,14 @@ declare function fn1<const T extends readonly unknown[]>(...args: T): T;
6464
> : ^
6565

6666
const res1 = fn1(..."hello");
67-
>res1 : readonly string[]
68-
> : ^^^^^^^^^^^^^^^^^
69-
>fn1(..."hello") : readonly string[]
70-
> : ^^^^^^^^^^^^^^^^^
67+
>res1 : readonly any[]
68+
> : ^^^^^^^^^^^^^^
69+
>fn1(..."hello") : readonly any[]
70+
> : ^^^^^^^^^^^^^^
7171
>fn1 : <const T extends readonly unknown[]>(...args: T) => T
7272
> : ^^^^^^^ ^^^^^^^^^ ^^^^^ ^^ ^^^^^
73-
>..."hello" : string
74-
> : ^^^^^^
73+
>..."hello" : any
74+
> : ^^^
7575
>"hello" : "hello"
7676
> : ^^^^^^^
7777

@@ -88,16 +88,16 @@ const res2 = fn1(...itNum);
8888
> : ^^^^^^^^^^^^^^^^
8989

9090
const res3 = fn1(true, ..."hello");
91-
>res3 : readonly [true, ...string[]]
92-
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
93-
>fn1(true, ..."hello") : readonly [true, ...string[]]
94-
> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
91+
>res3 : readonly [true, ...any[]]
92+
> : ^^^^^^^^^^^^^^^^^^^^^^^^^
93+
>fn1(true, ..."hello") : readonly [true, ...any[]]
94+
> : ^^^^^^^^^^^^^^^^^^^^^^^^^
9595
>fn1 : <const T extends readonly unknown[]>(...args: T) => T
9696
> : ^^^^^^^ ^^^^^^^^^ ^^^^^ ^^ ^^^^^
9797
>true : true
9898
> : ^^^^
99-
>..."hello" : string
100-
> : ^^^^^^
99+
>..."hello" : any
100+
> : ^^^
101101
>"hello" : "hello"
102102
> : ^^^^^^^
103103

@@ -123,14 +123,14 @@ declare function foo<T extends unknown[]>(...args: T): T;
123123
> : ^
124124

125125
const p1 = foo(..."hello");
126-
>p1 : string[]
127-
> : ^^^^^^^^
128-
>foo(..."hello") : string[]
129-
> : ^^^^^^^^
126+
>p1 : any[]
127+
> : ^^^^^
128+
>foo(..."hello") : any[]
129+
> : ^^^^^
130130
>foo : <T extends unknown[]>(...args: T) => T
131131
> : ^ ^^^^^^^^^ ^^^^^ ^^ ^^^^^
132-
>..."hello" : string
133-
> : ^^^^^^
132+
>..."hello" : any
133+
> : ^^^
134134
>"hello" : "hello"
135135
> : ^^^^^^^
136136

@@ -147,16 +147,16 @@ const p2 = foo(...itNum);
147147
> : ^^^^^^^^^^^^^^^^
148148

149149
const p3 = foo(true, ..."hello");
150-
>p3 : [boolean, ...string[]]
151-
> : ^^^^^^^^^^^^^^^^^^^^^^
152-
>foo(true, ..."hello") : [boolean, ...string[]]
153-
> : ^^^^^^^^^^^^^^^^^^^^^^
150+
>p3 : [boolean, ...any[]]
151+
> : ^^^^^^^^^^^^^^^^^^^
152+
>foo(true, ..."hello") : [boolean, ...any[]]
153+
> : ^^^^^^^^^^^^^^^^^^^
154154
>foo : <T extends unknown[]>(...args: T) => T
155155
> : ^ ^^^^^^^^^ ^^^^^ ^^ ^^^^^
156156
>true : true
157157
> : ^^^^
158-
>..."hello" : string
159-
> : ^^^^^^
158+
>..."hello" : any
159+
> : ^^^
160160
>"hello" : "hello"
161161
> : ^^^^^^^
162162

tests/baselines/reference/arrayBindingPatternOmittedExpressions.types

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,24 +62,20 @@ function f([, a, , b, , , , s, , , ] = results) {
6262
> : ^^^^^^^^
6363

6464
a = s[1];
65-
>a = s[1] : string
66-
> : ^^^^^^
65+
>a = s[1] : error
6766
>a : string
6867
> : ^^^^^^
69-
>s[1] : string
70-
> : ^^^^^^
68+
>s[1] : error
7169
>s : string
7270
> : ^^^^^^
7371
>1 : 1
7472
> : ^
7573

7674
b = s[2];
77-
>b = s[2] : string
78-
> : ^^^^^^
75+
>b = s[2] : error
7976
>b : string
8077
> : ^^^^^^
81-
>s[2] : string
82-
> : ^^^^^^
78+
>s[2] : error
8379
>s : string
8480
> : ^^^^^^
8581
>2 : 2

tests/baselines/reference/arrayLiteralWithMultipleBestCommonTypes.types

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ var cs = [a, b, c]; // { x: number; y?: number };[]
6060
> : ^^^^^ ^^^^^^ ^^^
6161

6262
var ds = [(x: Object) => 1, (x: string) => 2]; // { (x:Object) => number }[]
63-
>ds : ((x: Object) => number)[]
64-
> : ^^ ^^ ^^^^^^^^^^^^^^
65-
>[(x: Object) => 1, (x: string) => 2] : ((x: Object) => number)[]
66-
> : ^^ ^^ ^^^^^^^^^^^^^^
63+
>ds : (((x: Object) => number) | ((x: string) => number))[]
64+
> : ^^^ ^^ ^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^
65+
>[(x: Object) => 1, (x: string) => 2] : (((x: Object) => number) | ((x: string) => number))[]
66+
> : ^^^ ^^ ^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^
6767
>(x: Object) => 1 : (x: Object) => number
6868
> : ^ ^^ ^^^^^^^^^^^
6969
>x : Object
@@ -78,10 +78,10 @@ var ds = [(x: Object) => 1, (x: string) => 2]; // { (x:Object) => number }[]
7878
> : ^
7979

8080
var es = [(x: string) => 2, (x: Object) => 1]; // { (x:string) => number }[]
81-
>es : ((x: string) => number)[]
82-
> : ^^ ^^ ^^^^^^^^^^^^^^
83-
>[(x: string) => 2, (x: Object) => 1] : ((x: string) => number)[]
84-
> : ^^ ^^ ^^^^^^^^^^^^^^
81+
>es : (((x: string) => number) | ((x: Object) => number))[]
82+
> : ^^^ ^^ ^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^
83+
>[(x: string) => 2, (x: Object) => 1] : (((x: string) => number) | ((x: Object) => number))[]
84+
> : ^^^ ^^ ^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^
8585
>(x: string) => 2 : (x: string) => number
8686
> : ^ ^^ ^^^^^^^^^^^
8787
>x : string

0 commit comments

Comments
 (0)
0