Skip to content

Commit 240b101

Browse files
authored
Update submodule for new cherry-picks (#1996)
1 parent fef4d68 commit 240b101

19 files changed

+155
-369
lines changed

_submodules/TypeScript

Submodule TypeScript updated 44 files

testdata/baselines/reference/submodule/compiler/arrayAssignmentTest1.errors.txt.diff

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

testdata/baselines/reference/submodule/compiler/chainedCallsWithTypeParameterConstrainedToOtherTypeParameter.errors.txt.diff

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

testdata/baselines/reference/submodule/compiler/emitClassExpressionInDeclarationFile.js.diff

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,4 @@
2525
+ tags(c: any): any;
2626
};
2727
};
28-
export declare class FooItem {
29-
@@= skipped -10, +10 lines =@@
30-
export type Constructor<T> = new (...args: any[]) => T;
31-
export declare function WithTags<T extends Constructor<FooItem>>(Base: T): {
32-
new (...args: any[]): {
33-
+ tags(): void;
34-
foo(): void;
35-
name?: string;
36-
- tags(): void;
37-
};
38-
getTags(): void;
39-
} & T;
40-
declare const Test_base: {
41-
new (...args: any[]): {
42-
+ tags(): void;
43-
foo(): void;
44-
name?: string;
45-
- tags(): void;
46-
};
47-
getTags(): void;
48-
} & typeof FooItem;
28+
export declare class FooItem {
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
variancePropagation.ts(13,7): error TS2322: Type 'DerivedTable<{ base: Base; new: New; }>' is not assignable to type 'DerivedTable<{ base: Base; new: New & Base; }>'.
2+
Type '{ base: Base; new: New; }' is not assignable to type '{ base: Base; new: New & Base; }'.
3+
Types of property 'new' are incompatible.
4+
Type 'New' is not assignable to type 'New & Base'.
5+
Property 'baseProp' is missing in type 'New' but required in type 'Base'.
6+
7+
8+
==== variancePropagation.ts (1 errors) ====
9+
// https://github.com/microsoft/TypeScript/issues/62606
10+
11+
interface DerivedTable<S extends { base: any; new: any }> {
12+
// Error disappears when these property declarations are reversed
13+
schema: S["base"] & S["new"]
14+
readonlySchema: Readonly<S["base"] & S["new"]>
15+
}
16+
17+
interface Base { baseProp: number; }
18+
interface New { newProp: boolean; }
19+
20+
declare const source: DerivedTable<{ base: Base, new: New }>
21+
const destination: DerivedTable<{ base: Base; new: New & Base }> = source; // Error
22+
~~~~~~~~~~~
23+
!!! error TS2322: Type 'DerivedTable<{ base: Base; new: New; }>' is not assignable to type 'DerivedTable<{ base: Base; new: New & Base; }>'.
24+
!!! error TS2322: Type '{ base: Base; new: New; }' is not assignable to type '{ base: Base; new: New & Base; }'.
25+
!!! error TS2322: Types of property 'new' are incompatible.
26+
!!! error TS2322: Type 'New' is not assignable to type 'New & Base'.
27+
!!! error TS2322: Property 'baseProp' is missing in type 'New' but required in type 'Base'.
28+
!!! related TS2728 variancePropagation.ts:9:18: 'baseProp' is declared here.
29+
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
--- old.variancePropagation.errors.txt
2+
+++ new.variancePropagation.errors.txt
3+
@@= skipped -0, +0 lines =@@
4+
-<no content>
5+
+variancePropagation.ts(13,7): error TS2322: Type 'DerivedTable<{ base: Base; new: New; }>' is not assignable to type 'DerivedTable<{ base: Base; new: New & Base; }>'.
6+
+ Type '{ base: Base; new: New; }' is not assignable to type '{ base: Base; new: New & Base; }'.
7+
+ Types of property 'new' are incompatible.
8+
+ Type 'New' is not assignable to type 'New & Base'.
9+
+ Property 'baseProp' is missing in type 'New' but required in type 'Base'.
10+
+
11+
+
12+
+==== variancePropagation.ts (1 errors) ====
13+
+ // https://github.com/microsoft/TypeScript/issues/62606
14+
+
15+
+ interface DerivedTable<S extends { base: any; new: any }> {
16+
+ // Error disappears when these property declarations are reversed
17+
+ schema: S["base"] & S["new"]
18+
+ readonlySchema: Readonly<S["base"] & S["new"]>
19+
+ }
20+
+
21+
+ interface Base { baseProp: number; }
22+
+ interface New { newProp: boolean; }
23+
+
24+
+ declare const source: DerivedTable<{ base: Base, new: New }>
25+
+ const destination: DerivedTable<{ base: Base; new: New & Base }> = source; // Error
26+
+ ~~~~~~~~~~~
27+
+!!! error TS2322: Type 'DerivedTable<{ base: Base; new: New; }>' is not assignable to type 'DerivedTable<{ base: Base; new: New & Base; }>'.
28+
+!!! error TS2322: Type '{ base: Base; new: New; }' is not assignable to type '{ base: Base; new: New & Base; }'.
29+
+!!! error TS2322: Types of property 'new' are incompatible.
30+
+!!! error TS2322: Type 'New' is not assignable to type 'New & Base'.
31+
+!!! error TS2322: Property 'baseProp' is missing in type 'New' but required in type 'Base'.
32+
+!!! related TS2728 variancePropagation.ts:9:18: 'baseProp' is declared here.
33+
+
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
//// [tests/cases/compiler/variancePropagation.ts] ////
2+
3+
=== variancePropagation.ts ===
4+
// https://github.com/microsoft/TypeScript/issues/62606
5+
6+
interface DerivedTable<S extends { base: any; new: any }> {
7+
>DerivedTable : Symbol(DerivedTable, Decl(variancePropagation.ts, 0, 0))
8+
>S : Symbol(S, Decl(variancePropagation.ts, 2, 23))
9+
>base : Symbol(base, Decl(variancePropagation.ts, 2, 34))
10+
>new : Symbol(new, Decl(variancePropagation.ts, 2, 45))
11+
12+
// Error disappears when these property declarations are reversed
13+
schema: S["base"] & S["new"]
14+
>schema : Symbol(DerivedTable.schema, Decl(variancePropagation.ts, 2, 59))
15+
>S : Symbol(S, Decl(variancePropagation.ts, 2, 23))
16+
>S : Symbol(S, Decl(variancePropagation.ts, 2, 23))
17+
18+
readonlySchema: Readonly<S["base"] & S["new"]>
19+
>readonlySchema : Symbol(DerivedTable.readonlySchema, Decl(variancePropagation.ts, 4, 32))
20+
>Readonly : Symbol(Readonly, Decl(lib.es5.d.ts, --, --))
21+
>S : Symbol(S, Decl(variancePropagation.ts, 2, 23))
22+
>S : Symbol(S, Decl(variancePropagation.ts, 2, 23))
23+
}
24+
25+
interface Base { baseProp: number; }
26+
>Base : Symbol(Base, Decl(variancePropagation.ts, 6, 1))
27+
>baseProp : Symbol(Base.baseProp, Decl(variancePropagation.ts, 8, 16))
28+
29+
interface New { newProp: boolean; }
30+
>New : Symbol(New, Decl(variancePropagation.ts, 8, 36))
31+
>newProp : Symbol(New.newProp, Decl(variancePropagation.ts, 9, 16))
32+
33+
declare const source: DerivedTable<{ base: Base, new: New }>
34+
>source : Symbol(source, Decl(variancePropagation.ts, 11, 13))
35+
>DerivedTable : Symbol(DerivedTable, Decl(variancePropagation.ts, 0, 0))
36+
>base : Symbol(base, Decl(variancePropagation.ts, 11, 36))
37+
>Base : Symbol(Base, Decl(variancePropagation.ts, 6, 1))
38+
>new : Symbol(new, Decl(variancePropagation.ts, 11, 48))
39+
>New : Symbol(New, Decl(variancePropagation.ts, 8, 36))
40+
41+
const destination: DerivedTable<{ base: Base; new: New & Base }> = source; // Error
42+
>destination : Symbol(destination, Decl(variancePropagation.ts, 12, 5))
43+
>DerivedTable : Symbol(DerivedTable, Decl(variancePropagation.ts, 0, 0))
44+
>base : Symbol(base, Decl(variancePropagation.ts, 12, 33))
45+
>Base : Symbol(Base, Decl(variancePropagation.ts, 6, 1))
46+
>new : Symbol(new, Decl(variancePropagation.ts, 12, 45))
47+
>New : Symbol(New, Decl(variancePropagation.ts, 8, 36))
48+
>Base : Symbol(Base, Decl(variancePropagation.ts, 6, 1))
49+
>source : Symbol(source, Decl(variancePropagation.ts, 11, 13))
50+
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
//// [tests/cases/compiler/variancePropagation.ts] ////
2+
3+
=== variancePropagation.ts ===
4+
// https://github.com/microsoft/TypeScript/issues/62606
5+
6+
interface DerivedTable<S extends { base: any; new: any }> {
7+
>base : any
8+
>new : any
9+
10+
// Error disappears when these property declarations are reversed
11+
schema: S["base"] & S["new"]
12+
>schema : S["base"] & S["new"]
13+
14+
readonlySchema: Readonly<S["base"] & S["new"]>
15+
>readonlySchema : Readonly<S["base"] & S["new"]>
16+
}
17+
18+
interface Base { baseProp: number; }
19+
>baseProp : number
20+
21+
interface New { newProp: boolean; }
22+
>newProp : boolean
23+
24+
declare const source: DerivedTable<{ base: Base, new: New }>
25+
>source : DerivedTable<{ base: Base; new: New; }>
26+
>base : Base
27+
>new : New
28+
29+
const destination: DerivedTable<{ base: Base; new: New & Base }> = source; // Error
30+
>destination : DerivedTable<{ base: Base; new: New & Base; }>
31+
>base : Base
32+
>new : New & Base
33+
>source : DerivedTable<{ base: Base; new: New; }>
34+

testdata/baselines/reference/submodule/conformance/assignmentCompatWithCallSignatures3.errors.txt.diff

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@
99
Types of parameters 'y' and 'y' are incompatible.
1010
Type 'T' is not assignable to type 'Derived2[]'.
1111
Type 'Base[]' is not assignable to type 'Derived2[]'.
12-
- Type 'Base' is missing the following properties from type 'Derived2': bar, baz
12+
Type 'Base' is missing the following properties from type 'Derived2': baz, bar
1313
-assignmentCompatWithCallSignatures3.ts(83,1): error TS2322: Type '(x: Base[], y: Derived[]) => Derived[]' is not assignable to type '<T extends Array<Derived>>(x: Base[], y: T) => T'.
14-
+ Type 'Base' is missing the following properties from type 'Derived2': baz, bar
1514
+assignmentCompatWithCallSignatures3.ts(83,1): error TS2322: Type '(x: Base[], y: Derived[]) => Derived[]' is not assignable to type '<T extends Derived[]>(x: Base[], y: T) => T'.
1615
Type 'Derived[]' is not assignable to type 'T'.
1716
'Derived[]' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'Derived[]'.
@@ -25,9 +24,7 @@
2524
!!! error TS2322: Types of parameters 'y' and 'y' are incompatible.
2625
!!! error TS2322: Type 'T' is not assignable to type 'Derived2[]'.
2726
!!! error TS2322: Type 'Base[]' is not assignable to type 'Derived2[]'.
28-
-!!! error TS2322: Type 'Base' is missing the following properties from type 'Derived2': bar, baz
29-
+!!! error TS2322: Type 'Base' is missing the following properties from type 'Derived2': baz, bar
30-
var b13: <T extends Array<Derived>>(x: Array<Base>, y: T) => T;
27+
@@= skipped -9, +9 lines =@@
3128
a13 = b13; // ok
3229
b13 = a13; // ok
3330
~~~

testdata/baselines/reference/submodule/conformance/assignmentCompatWithConstructSignatures3.errors.txt.diff

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@
99
Types of parameters 'y' and 'y' are incompatible.
1010
Type 'T' is not assignable to type 'Derived2[]'.
1111
Type 'Base[]' is not assignable to type 'Derived2[]'.
12-
- Type 'Base' is missing the following properties from type 'Derived2': bar, baz
12+
Type 'Base' is missing the following properties from type 'Derived2': baz, bar
1313
-assignmentCompatWithConstructSignatures3.ts(83,1): error TS2322: Type 'new (x: Base[], y: Derived[]) => Derived[]' is not assignable to type 'new <T extends Array<Derived>>(x: Base[], y: T) => T'.
14-
+ Type 'Base' is missing the following properties from type 'Derived2': baz, bar
1514
+assignmentCompatWithConstructSignatures3.ts(83,1): error TS2322: Type 'new (x: Base[], y: Derived[]) => Derived[]' is not assignable to type 'new <T extends Derived[]>(x: Base[], y: T) => T'.
1615
Type 'Derived[]' is not assignable to type 'T'.
1716
'Derived[]' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint 'Derived[]'.
@@ -25,9 +24,7 @@
2524
!!! error TS2322: Types of parameters 'y' and 'y' are incompatible.
2625
!!! error TS2322: Type 'T' is not assignable to type 'Derived2[]'.
2726
!!! error TS2322: Type 'Base[]' is not assignable to type 'Derived2[]'.
28-
-!!! error TS2322: Type 'Base' is missing the following properties from type 'Derived2': bar, baz
29-
+!!! error TS2322: Type 'Base' is missing the following properties from type 'Derived2': baz, bar
30-
var b13: new <T extends Array<Derived>>(x: Array<Base>, y: T) => T;
27+
@@= skipped -9, +9 lines =@@
3128
a13 = b13; // ok
3229
b13 = a13; // ok
3330
~~~

0 commit comments

Comments
 (0)