Skip to content

Commit c881d97

Browse files
committed
Accept baselines for now
1 parent 87613bc commit c881d97

13 files changed

+744
-96
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
1-
tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType9_ES5.ts(6,5): error TS2322: Type '{ [x: number]: 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/computedPropertyNamesContextualType9_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/computedPropertyNamesContextualType9_ES5.ts(8,5): error TS2418: Type of computed property's value is 'number', which is not assignable to type 'boolean'.
53

64

7-
==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType9_ES5.ts (1 errors) ====
5+
==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType9_ES5.ts (2 errors) ====
86
interface I {
97
[s: string]: boolean;
108
[s: number]: boolean;
119
}
1210

1311
var o: I = {
14-
~
15-
!!! error TS2322: Type '{ [x: number]: 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'.
1912
[+"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/computedPropertyNamesContextualType9_ES5.ts:2:5: The expected type comes from this index signature.
2016
[+"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/computedPropertyNamesContextualType9_ES5.ts:2:5: The expected type comes from this index signature.
2120
}
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
1-
tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType9_ES6.ts(6,5): error TS2322: Type '{ [x: number]: 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/computedPropertyNamesContextualType9_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/computedPropertyNamesContextualType9_ES6.ts(8,5): error TS2418: Type of computed property's value is 'number', which is not assignable to type 'boolean'.
53

64

7-
==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType9_ES6.ts (1 errors) ====
5+
==== tests/cases/conformance/es6/computedProperties/computedPropertyNamesContextualType9_ES6.ts (2 errors) ====
86
interface I {
97
[s: string]: boolean;
108
[s: number]: boolean;
119
}
1210

1311
var o: I = {
14-
~
15-
!!! error TS2322: Type '{ [x: number]: 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'.
1912
[+"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/computedPropertyNamesContextualType9_ES6.ts:2:5: The expected type comes from this index signature.
2016
[+"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/computedPropertyNamesContextualType9_ES6.ts:2:5: The expected type comes from this index signature.
2120
}

tests/baselines/reference/conditionalTypesExcessProperties.errors.txt

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
tests/cases/conformance/types/conditional/conditionalTypesExcessProperties.ts(8,5): error TS2322: Type '{ test: string; arg: A; }' is not assignable to type 'Something<A>'.
22
Type '{ test: string; arg: A; }' is not assignable to type 'A extends object ? { arg: A; } : { arg?: undefined; }'.
3-
tests/cases/conformance/types/conditional/conditionalTypesExcessProperties.ts(9,33): error TS2322: Type 'A' is not assignable to type 'Something<A>["arr"]'.
4-
Type 'object' is not assignable to type 'Something<A>["arr"]'.
3+
tests/cases/conformance/types/conditional/conditionalTypesExcessProperties.ts(9,33): error TS2322: Type '{ test: string; arg: A; arr: A; }' is not assignable to type 'Something<A>'.
4+
Object literal may only specify known properties, and 'arr' does not exist in type 'Something<A>'.
55

66

77
==== tests/cases/conformance/types/conditional/conditionalTypesExcessProperties.ts (2 errors) ====
@@ -17,8 +17,8 @@ tests/cases/conformance/types/conditional/conditionalTypesExcessProperties.ts(9,
1717
!!! error TS2322: Type '{ test: string; arg: A; }' is not assignable to type 'Something<A>'.
1818
!!! error TS2322: Type '{ test: string; arg: A; }' is not assignable to type 'A extends object ? { arg: A; } : { arg?: undefined; }'.
1919
sa = { test: 'bye', arg: a, arr: a } // excess
20-
~~~
21-
!!! error TS2322: Type 'A' is not assignable to type 'Something<A>["arr"]'.
22-
!!! error TS2322: Type 'object' is not assignable to type 'Something<A>["arr"]'.
20+
~~~~~~
21+
!!! error TS2322: Type '{ test: string; arg: A; arr: A; }' is not assignable to type 'Something<A>'.
22+
!!! error TS2322: Object literal may only specify known properties, and 'arr' does not exist in type 'Something<A>'.
2323
}
2424

tests/baselines/reference/deferredLookupTypeResolution2.errors.txt

-31
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
tests/cases/compiler/indexedAccessRelation.ts(16,23): error TS2345: Argument of type '{ a: T; }' is not assignable to parameter of type 'Pick<S & State<T>, "a">'.
2+
Types of property 'a' are incompatible.
3+
Type 'T' is not assignable to type 'S["a"] & T'.
4+
Type 'Foo' is not assignable to type 'S["a"] & T'.
5+
Type 'Foo' is not assignable to type 'S["a"]'.
6+
Type 'T' is not assignable to type 'S["a"]'.
7+
Type 'Foo' is not assignable to type 'S["a"]'.
8+
9+
10+
==== tests/cases/compiler/indexedAccessRelation.ts (1 errors) ====
11+
// Repro from #14723
12+
13+
class Component<S> {
14+
setState<K extends keyof S>(state: Pick<S, K>) {}
15+
}
16+
17+
export interface State<T> {
18+
a?: T;
19+
}
20+
21+
class Foo {}
22+
23+
class Comp<T extends Foo, S> extends Component<S & State<T>>
24+
{
25+
foo(a: T) {
26+
this.setState({ a: a });
27+
~~~~~~~~
28+
!!! error TS2345: Argument of type '{ a: T; }' is not assignable to parameter of type 'Pick<S & State<T>, "a">'.
29+
!!! error TS2345: Types of property 'a' are incompatible.
30+
!!! error TS2345: Type 'T' is not assignable to type 'S["a"] & T'.
31+
!!! error TS2345: Type 'Foo' is not assignable to type 'S["a"] & T'.
32+
!!! error TS2345: Type 'Foo' is not assignable to type 'S["a"]'.
33+
!!! error TS2345: Type 'T' is not assignable to type 'S["a"]'.
34+
!!! error TS2345: Type 'Foo' is not assignable to type 'S["a"]'.
35+
}
36+
}
37+

tests/baselines/reference/indexedAccessRelation.types

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class Comp<T extends Foo, S> extends Component<S & State<T>>
2626
>a : T
2727

2828
this.setState({ a: a });
29-
>this.setState({ a: a }) : void
29+
>this.setState({ a: a }) : any
3030
>this.setState : <K extends keyof S | "a">(state: Pick<S & State<T>, K>) => void
3131
>this : this
3232
>setState : <K extends keyof S | "a">(state: Pick<S & State<T>, K>) => void

tests/baselines/reference/indexingTypesWithNever.types

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ declare function genericFn3<
6969

7070
// Should be never
7171
const result5 = genericFn3({ g: "gtest", h: "htest" }, "g", "h"); // 'g' & 'h' will reduce to never
72-
>result5 : any
73-
>genericFn3({ g: "gtest", h: "htest" }, "g", "h") : any
72+
>result5 : unknown
73+
>genericFn3({ g: "gtest", h: "htest" }, "g", "h") : unknown
7474
>genericFn3 : <T extends { [K in keyof T]: T[K]; }, U extends keyof T, V extends keyof T>(obj: T, u: U, v: V) => T[U & V]
7575
>{ g: "gtest", h: "htest" } : { g: string; h: string; }
7676
>g : string

0 commit comments

Comments
 (0)