Skip to content

Commit 13cf64e

Browse files
committed
Accept new baselines
1 parent df7d7be commit 13cf64e

24 files changed

+79
-95
lines changed

tests/baselines/reference/assignmentNonObjectTypeConstraints.types

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ function bar<T extends A | B>(x: T) {
4040

4141
var y: A | B = x; // Ok
4242
>y : A | B
43-
>x : T
43+
>x : A | B
4444
}
4545

4646
bar(new A);

tests/baselines/reference/conditionalTypes1.errors.txt

+1-15
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,11 @@ tests/cases/conformance/types/conditional/conditionalTypes1.ts(12,5): error TS23
22
tests/cases/conformance/types/conditional/conditionalTypes1.ts(17,5): error TS2322: Type 'T' is not assignable to type 'NonNullable<T>'.
33
Type 'string | undefined' is not assignable to type 'NonNullable<T>'.
44
Type 'undefined' is not assignable to type 'NonNullable<T>'.
5-
tests/cases/conformance/types/conditional/conditionalTypes1.ts(18,9): error TS2322: Type 'T' is not assignable to type 'string'.
6-
Type 'string | undefined' is not assignable to type 'string'.
7-
Type 'undefined' is not assignable to type 'string'.
85
tests/cases/conformance/types/conditional/conditionalTypes1.ts(24,5): error TS2322: Type 'T[keyof T] | undefined' is not assignable to type 'NonNullable<Partial<T>[keyof T]>'.
96
Type 'undefined' is not assignable to type 'NonNullable<Partial<T>[keyof T]>'.
107
tests/cases/conformance/types/conditional/conditionalTypes1.ts(29,5): error TS2322: Type 'T["x"]' is not assignable to type 'NonNullable<T["x"]>'.
118
Type 'string | undefined' is not assignable to type 'NonNullable<T["x"]>'.
129
Type 'undefined' is not assignable to type 'NonNullable<T["x"]>'.
13-
tests/cases/conformance/types/conditional/conditionalTypes1.ts(30,9): error TS2322: Type 'T["x"]' is not assignable to type 'string'.
14-
Type 'string | undefined' is not assignable to type 'string'.
15-
Type 'undefined' is not assignable to type 'string'.
1610
tests/cases/conformance/types/conditional/conditionalTypes1.ts(103,5): error TS2322: Type 'FunctionProperties<T>' is not assignable to type 'T'.
1711
'T' could be instantiated with an arbitrary type which could be unrelated to 'FunctionProperties<T>'.
1812
tests/cases/conformance/types/conditional/conditionalTypes1.ts(104,5): error TS2322: Type 'NonFunctionProperties<T>' is not assignable to type 'T'.
@@ -63,7 +57,7 @@ tests/cases/conformance/types/conditional/conditionalTypes1.ts(288,43): error TS
6357
Type 'boolean' is not assignable to type 'true'.
6458

6559

66-
==== tests/cases/conformance/types/conditional/conditionalTypes1.ts (22 errors) ====
60+
==== tests/cases/conformance/types/conditional/conditionalTypes1.ts (20 errors) ====
6761
type T00 = Exclude<"a" | "b" | "c" | "d", "a" | "c" | "f">; // "b" | "d"
6862
type T01 = Extract<"a" | "b" | "c" | "d", "a" | "c" | "f">; // "a" | "c"
6963

@@ -88,10 +82,6 @@ tests/cases/conformance/types/conditional/conditionalTypes1.ts(288,43): error TS
8882
!!! error TS2322: Type 'string | undefined' is not assignable to type 'NonNullable<T>'.
8983
!!! error TS2322: Type 'undefined' is not assignable to type 'NonNullable<T>'.
9084
let s1: string = x; // Error
91-
~~
92-
!!! error TS2322: Type 'T' is not assignable to type 'string'.
93-
!!! error TS2322: Type 'string | undefined' is not assignable to type 'string'.
94-
!!! error TS2322: Type 'undefined' is not assignable to type 'string'.
9585
let s2: string = y;
9686
}
9787

@@ -111,10 +101,6 @@ tests/cases/conformance/types/conditional/conditionalTypes1.ts(288,43): error TS
111101
!!! error TS2322: Type 'string | undefined' is not assignable to type 'NonNullable<T["x"]>'.
112102
!!! error TS2322: Type 'undefined' is not assignable to type 'NonNullable<T["x"]>'.
113103
let s1: string = x; // Error
114-
~~
115-
!!! error TS2322: Type 'T["x"]' is not assignable to type 'string'.
116-
!!! error TS2322: Type 'string | undefined' is not assignable to type 'string'.
117-
!!! error TS2322: Type 'undefined' is not assignable to type 'string'.
118104
let s2: string = y;
119105
}
120106

tests/baselines/reference/conditionalTypes1.types

+4-4
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ function f2<T extends string | undefined>(x: T, y: NonNullable<T>) {
5151

5252
let s1: string = x; // Error
5353
>s1 : string
54-
>x : T
54+
>x : string
5555

5656
let s2: string = y;
5757
>s2 : string
@@ -92,7 +92,7 @@ function f4<T extends { x: string | undefined }>(x: T["x"], y: NonNullable<T["x"
9292

9393
let s1: string = x; // Error
9494
>s1 : string
95-
>x : T["x"]
95+
>x : string
9696

9797
let s2: string = y;
9898
>s2 : string
@@ -476,11 +476,11 @@ function f21<T extends number | string>(x: T, y: ZeroOf<T>) {
476476

477477
let z1: number | string = y;
478478
>z1 : string | number
479-
>y : ZeroOf<T>
479+
>y : "" | 0
480480

481481
let z2: 0 | "" = y;
482482
>z2 : "" | 0
483-
>y : ZeroOf<T>
483+
>y : "" | 0
484484

485485
x = y; // Error
486486
>x = y : ZeroOf<T>

tests/baselines/reference/deeplyNestedConstraints.types

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class BufferPool<E extends Enum, M extends TypeMap<E>> {
1717

1818
array.length; // Requires exploration of >5 levels of constraints
1919
>array.length : number
20-
>array : Extract<M[K], ArrayLike<any>>
20+
>array : string | number[]
2121
>length : number
2222
}
2323
}

tests/baselines/reference/enumPropertyAccess.errors.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
tests/cases/compiler/enumPropertyAccess.ts(7,11): error TS2339: Property 'Green' does not exist on type 'Colors.Red'.
2-
tests/cases/compiler/enumPropertyAccess.ts(12,7): error TS2339: Property 'Green' does not exist on type 'B'.
2+
tests/cases/compiler/enumPropertyAccess.ts(12,7): error TS2339: Property 'Green' does not exist on type 'Colors'.
33

44

55
==== tests/cases/compiler/enumPropertyAccess.ts (2 errors) ====
@@ -18,6 +18,6 @@ tests/cases/compiler/enumPropertyAccess.ts(12,7): error TS2339: Property 'Green'
1818
function fill<B extends Colors>(f: B) {
1919
f.Green; // error
2020
~~~~~
21-
!!! error TS2339: Property 'Green' does not exist on type 'B'.
21+
!!! error TS2339: Property 'Green' does not exist on type 'Colors'.
2222
f.toFixed(); // ok
2323
}

tests/baselines/reference/enumPropertyAccess.types

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ function fill<B extends Colors>(f: B) {
3434

3535
f.Green; // error
3636
>f.Green : any
37-
>f : B
37+
>f : Colors
3838
>Green : any
3939

4040
f.toFixed(); // ok
4141
>f.toFixed() : string
4242
>f.toFixed : (fractionDigits?: number) => string
43-
>f : B
43+
>f : Colors
4444
>toFixed : (fractionDigits?: number) => string
4545
}

tests/baselines/reference/functionCallOnConstrainedTypeVariable.types

+4-4
Original file line numberDiff line numberDiff line change
@@ -37,24 +37,24 @@ function callN<T extends A | B>(p: T) {
3737
p.a("s"); // Error
3838
>p.a("s") : string
3939
>p.a : ((x: number) => string) | ((x: boolean) => string)
40-
>p : T
40+
>p : A | B
4141
>a : ((x: number) => string) | ((x: boolean) => string)
4242
>"s" : "s"
4343

4444
var a: T["a"] = p.a;
4545
>a : T["a"]
4646
>p.a : ((x: number) => string) | ((x: boolean) => string)
47-
>p : T
47+
>p : A | B
4848
>a : ((x: number) => string) | ((x: boolean) => string)
4949

5050
a(""); // Error
5151
>a("") : string
52-
>a : T["a"]
52+
>a : ((x: number) => string) | ((x: boolean) => string)
5353
>"" : ""
5454

5555
a("", "", "", ""); // Error
5656
>a("", "", "", "") : string
57-
>a : T["a"]
57+
>a : ((x: number) => string) | ((x: boolean) => string)
5858
>"" : ""
5959
>"" : ""
6060
>"" : ""

tests/baselines/reference/intrinsicTypes.types

+1-1
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ function foo2<T extends 'foo' | 'bar'>(x: Uppercase<T>) {
132132

133133
let s: 'FOO' | 'BAR' = x;
134134
>s : "FOO" | "BAR"
135-
>x : Uppercase<T>
135+
>x : "FOO" | "BAR"
136136
}
137137

138138
declare function foo3<T extends string>(x: Uppercase<T>): T;

tests/baselines/reference/keyofAndIndexedAccess.types

+2-2
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@ function f50<T>(k: keyof T, s: string) {
630630
const x2 = k as string;
631631
>x2 : string
632632
>k as string : string
633-
>k : keyof T
633+
>k : string | number | symbol
634634
}
635635

636636
function f51<T, K extends keyof T>(k: K, s: string) {
@@ -646,7 +646,7 @@ function f51<T, K extends keyof T>(k: K, s: string) {
646646
const x2 = k as string;
647647
>x2 : string
648648
>k as string : string
649-
>k : K
649+
>k : string | number | symbol
650650
}
651651

652652
function f52<T>(obj: { [x: string]: boolean }, k: Exclude<keyof T, symbol>, s: string, n: number) {

tests/baselines/reference/keyofAndIndexedAccess2.types

+1-1
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ function fn<T extends {elements: Array<string>} | {elements: Array<number>}>(par
452452
>cb : (element: T["elements"][number]) => void
453453
>param.elements[0] : string | number
454454
>param.elements : string[] | number[]
455-
>param : T
455+
>param : { elements: string[]; } | { elements: number[]; }
456456
>elements : string[] | number[]
457457
>0 : 0
458458
}

tests/baselines/reference/narrowingByTypeofInSwitch.symbols

+2-2
Original file line numberDiff line numberDiff line change
@@ -404,9 +404,9 @@ function exhaustiveChecksGenerics<T extends L | R | number | string>(x: T): stri
404404
>x : Symbol(x, Decl(narrowingByTypeofInSwitch.ts, 146, 69))
405405

406406
case 'number': return x.toString(2);
407-
>x.toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 2 more)
407+
>x.toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --))
408408
>x : Symbol(x, Decl(narrowingByTypeofInSwitch.ts, 146, 69))
409-
>toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --), Decl(lib.es5.d.ts, --, --) ... and 2 more)
409+
>toString : Symbol(Number.toString, Decl(lib.es5.d.ts, --, --))
410410

411411
case 'string': return x;
412412
>x : Symbol(x, Decl(narrowingByTypeofInSwitch.ts, 146, 69))

0 commit comments

Comments
 (0)