Skip to content

Commit 0ed8bff

Browse files
Accepted baselines.
1 parent 17b7226 commit 0ed8bff

10 files changed

+24
-233
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
tests/cases/conformance/types/conditional/conditionalTypesExcessProperties.ts(8,5): error TS2322: Type '{ test: string; arg: object; }' is not assignable to type 'Something<A>'.
2-
Type '{ test: string; arg: object; }' is not assignable to type 'A extends object ? { arg: A; } : { arg?: undefined; }'.
3-
tests/cases/conformance/types/conditional/conditionalTypesExcessProperties.ts(9,5): error TS2322: Type '{ test: string; arg: object; arr: A; }' is not assignable to type 'Something<A>'.
4-
Type '{ test: string; arg: object; arr: A; }' is not assignable to type 'A extends object ? { arg: A; } : { arg?: undefined; }'.
1+
tests/cases/conformance/types/conditional/conditionalTypesExcessProperties.ts(8,5): error TS2322: Type '{ test: string; arg: A; }' is not assignable to type 'Something<A>'.
2+
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,5): error TS2322: Type '{ test: string; arg: A; arr: A; }' is not assignable to type 'Something<A>'.
4+
Type '{ test: string; arg: A; arr: A; }' is not assignable to type 'A extends object ? { arg: A; } : { arg?: undefined; }'.
55

66

77
==== tests/cases/conformance/types/conditional/conditionalTypesExcessProperties.ts (2 errors) ====
@@ -14,11 +14,11 @@ tests/cases/conformance/types/conditional/conditionalTypesExcessProperties.ts(9,
1414
function testFunc2<A extends object>(a: A, sa: Something<A>) {
1515
sa = { test: 'hi', arg: a }; // not excess (but currently still not assignable)
1616
~~
17-
!!! error TS2322: Type '{ test: string; arg: object; }' is not assignable to type 'Something<A>'.
18-
!!! error TS2322: Type '{ test: string; arg: object; }' is not assignable to type 'A extends object ? { arg: A; } : { arg?: undefined; }'.
17+
!!! error TS2322: Type '{ test: string; arg: A; }' is not assignable to type 'Something<A>'.
18+
!!! 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
2020
~~
21-
!!! error TS2322: Type '{ test: string; arg: object; arr: A; }' is not assignable to type 'Something<A>'.
22-
!!! error TS2322: Type '{ test: string; arg: object; arr: A; }' is not assignable to type 'A extends object ? { arg: A; } : { arg?: undefined; }'.
21+
!!! error TS2322: Type '{ test: string; arg: A; arr: A; }' is not assignable to type 'Something<A>'.
22+
!!! error TS2322: Type '{ test: string; arg: A; arr: A; }' is not assignable to type 'A extends object ? { arg: A; } : { arg?: undefined; }'.
2323
}
2424

tests/baselines/reference/conditionalTypesExcessProperties.types

+8-8
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,22 @@ function testFunc2<A extends object>(a: A, sa: Something<A>) {
1818
>sa : Something<A>
1919

2020
sa = { test: 'hi', arg: a }; // not excess (but currently still not assignable)
21-
>sa = { test: 'hi', arg: a } : { test: string; arg: object; }
21+
>sa = { test: 'hi', arg: a } : { test: string; arg: A; }
2222
>sa : Something<A>
23-
>{ test: 'hi', arg: a } : { test: string; arg: object; }
23+
>{ test: 'hi', arg: a } : { test: string; arg: A; }
2424
>test : string
2525
>'hi' : "hi"
26-
>arg : object
27-
>a : object
26+
>arg : A
27+
>a : A
2828

2929
sa = { test: 'bye', arg: a, arr: a } // excess
30-
>sa = { test: 'bye', arg: a, arr: a } : { test: string; arg: object; arr: A; }
30+
>sa = { test: 'bye', arg: a, arr: a } : { test: string; arg: A; arr: A; }
3131
>sa : Something<A>
32-
>{ test: 'bye', arg: a, arr: a } : { test: string; arg: object; arr: A; }
32+
>{ test: 'bye', arg: a, arr: a } : { test: string; arg: A; arr: A; }
3333
>test : string
3434
>'bye' : "bye"
35-
>arg : object
36-
>a : object
35+
>arg : A
36+
>a : A
3737
>arr : A
3838
>a : A
3939
}

tests/baselines/reference/contextualNarrowingFromUnknownToObjects(strictnullchecks=false).errors.txt

-77
This file was deleted.

tests/baselines/reference/contextualNarrowingFromUnknownToObjects(strictnullchecks=true).errors.txt

-93
This file was deleted.

tests/baselines/reference/crashInGetTextOfComputedPropertyName.errors.txt

-36
This file was deleted.

tests/baselines/reference/esNextWeakRefs_IterableWeakMap.types

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ export class IterableWeakMap<K extends object, V> implements WeakMap<K, V> {
134134
>this.#finalizationGroup : FinalizationRegistry<{ readonly ref: WeakRef<object>; readonly set: Set<WeakRef<object>>; }>
135135
>this : this
136136
>register : (target: object, heldValue: { readonly ref: WeakRef<object>; readonly set: Set<WeakRef<object>>; }, unregisterToken?: object | undefined) => void
137-
>key : object
137+
>key : K
138138
>{ set: this.#refSet, ref, } : { set: Set<WeakRef<K>>; ref: WeakRef<K>; }
139139

140140
set: this.#refSet,

tests/baselines/reference/logicalOrOperatorWithTypeParameters.types

+3-3
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,9 @@ function fn3<T extends { a: string; b: string }, U extends { a: string; b: numbe
8686

8787
var r2: {} = t || u;
8888
>r2 : {}
89-
>t || u : { a: string; b: string; } | { a: string; b: number; }
90-
>t : { a: string; b: string; }
91-
>u : { a: string; b: number; }
89+
>t || u : T | U
90+
>t : T
91+
>u : U
9292

9393
var r3 = t || { a: '' };
9494
>r3 : T | { a: string; }

tests/baselines/reference/mappedTypeConstraints2.types

+1-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ function validate<T extends object>(obj: T, bounds: NumericBoundsOf<T>) {
9696
>Object.entries : { <T>(o: { [s: string]: T; } | ArrayLike<T>): [string, T][]; (o: {}): [string, any][]; }
9797
>Object : ObjectConstructor
9898
>entries : { <T>(o: { [s: string]: T; } | ArrayLike<T>): [string, T][]; (o: {}): [string, any][]; }
99-
>obj : object
99+
>obj : T
100100

101101
const boundsForKey = bounds[key as keyof NumericBoundsOf<T>];
102102
>boundsForKey : NumericBoundsOf<T>[keyof NumericBoundsOf<T>]

tests/baselines/reference/nonPrimitiveInGeneric.types

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function bound<T extends object>(t: T) {
4141

4242
var o: object = t; // ok
4343
>o : object
44-
>t : object
44+
>t : T
4545
}
4646

4747
bound({});
@@ -89,7 +89,7 @@ function bound3<T extends {}>(t: T) {
8989

9090
var o: object = t; // ok
9191
>o : object
92-
>t : {}
92+
>t : T
9393
}
9494

9595
interface Proxy<T extends object> {}

tests/baselines/reference/objectRestNegative.errors.txt

+1-4
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@ tests/cases/conformance/types/rest/objectRestNegative.ts(6,10): error TS2322: Ty
55
tests/cases/conformance/types/rest/objectRestNegative.ts(9,31): error TS2462: A rest element must be last in a destructuring pattern.
66
tests/cases/conformance/types/rest/objectRestNegative.ts(11,30): error TS7008: Member 'x' implicitly has an 'any' type.
77
tests/cases/conformance/types/rest/objectRestNegative.ts(11,33): error TS7008: Member 'y' implicitly has an 'any' type.
8-
tests/cases/conformance/types/rest/objectRestNegative.ts(17,6): error TS2698: Spread types may only be created from object types.
98
tests/cases/conformance/types/rest/objectRestNegative.ts(17,9): error TS2701: The target of an object rest assignment must be a variable or a property access.
109

1110

12-
==== tests/cases/conformance/types/rest/objectRestNegative.ts (7 errors) ====
11+
==== tests/cases/conformance/types/rest/objectRestNegative.ts (6 errors) ====
1312
let o = { a: 1, b: 'no' };
1413
var { ...mustBeLast, a } = o;
1514
~~~~~~~~~~
@@ -39,8 +38,6 @@ tests/cases/conformance/types/rest/objectRestNegative.ts(17,9): error TS2701: Th
3938

4039
let rest: { b: string }
4140
({a, ...rest.b + rest.b} = o);
42-
~~~~~~~~~~~~~~~~~~
43-
!!! error TS2698: Spread types may only be created from object types.
4441
~~~~~~~~~~~~~~~
4542
!!! error TS2701: The target of an object rest assignment must be a variable or a property access.
4643

0 commit comments

Comments
 (0)