Skip to content

Commit b9f85fd

Browse files
committed
Update baselines
1 parent a1c92eb commit b9f85fd

9 files changed

+242
-68
lines changed

tests/baselines/reference/declarationEmitExpressionInExtends2.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,6 @@ declare class C<T, U> {
4545
y: U;
4646
}
4747
declare function getClass<T>(c: T): typeof C;
48-
declare class MyClass extends C<string, number> {
48+
declare var _MyClass_intersection_base: typeof C;
49+
declare class MyClass extends _MyClass_intersection_base<string, number> {
4950
}

tests/baselines/reference/declarationEmitExpressionInExtends3.errors.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
tests/cases/compiler/declarationEmitExpressionInExtends3.ts(28,30): error TS4020: 'extends' clause of exported class 'MyClass' has or is using private name 'LocalClass'.
2-
tests/cases/compiler/declarationEmitExpressionInExtends3.ts(36,31): error TS4020: 'extends' clause of exported class 'MyClass3' has or is using private name 'LocalInterface'.
2+
tests/cases/compiler/declarationEmitExpressionInExtends3.ts(36,75): error TS4020: 'extends' clause of exported class 'MyClass3' has or is using private name 'LocalInterface'.
33

44

55
==== tests/cases/compiler/declarationEmitExpressionInExtends3.ts (2 errors) ====
@@ -41,7 +41,7 @@ tests/cases/compiler/declarationEmitExpressionInExtends3.ts(36,31): error TS4020
4141

4242

4343
export class MyClass3 extends getExportedClass<LocalInterface>(undefined)<LocalInterface> { // Error LocalInterface is inaccisble
44-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
44+
~~~~~~~~~~~~~~
4545
!!! error TS4020: 'extends' clause of exported class 'MyClass3' has or is using private name 'LocalInterface'.
4646
}
4747

tests/baselines/reference/declarationEmitExpressionInExtends4.errors.txt

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,27 @@
11
tests/cases/compiler/declarationEmitExpressionInExtends4.ts(1,10): error TS4060: Return type of exported function has or is using private name 'D'.
2-
tests/cases/compiler/declarationEmitExpressionInExtends4.ts(5,7): error TS4093: 'extends' clause of exported class 'C' refers to a type whose name cannot be referenced.
32
tests/cases/compiler/declarationEmitExpressionInExtends4.ts(5,17): error TS2315: Type 'D' is not generic.
4-
tests/cases/compiler/declarationEmitExpressionInExtends4.ts(9,7): error TS4093: 'extends' clause of exported class 'C2' refers to a type whose name cannot be referenced.
3+
tests/cases/compiler/declarationEmitExpressionInExtends4.ts(5,17): error TS4020: 'extends' clause of exported class 'C' has or is using private name 'D'.
54
tests/cases/compiler/declarationEmitExpressionInExtends4.ts(9,18): error TS2304: Cannot find name 'SomeUndefinedFunction'.
65
tests/cases/compiler/declarationEmitExpressionInExtends4.ts(14,18): error TS2304: Cannot find name 'SomeUndefinedFunction'.
76
tests/cases/compiler/declarationEmitExpressionInExtends4.ts(14,18): error TS4020: 'extends' clause of exported class 'C3' has or is using private name 'SomeUndefinedFunction'.
87

98

10-
==== tests/cases/compiler/declarationEmitExpressionInExtends4.ts (7 errors) ====
9+
==== tests/cases/compiler/declarationEmitExpressionInExtends4.ts (6 errors) ====
1110
function getSomething() {
1211
~~~~~~~~~~~~
1312
!!! error TS4060: Return type of exported function has or is using private name 'D'.
1413
return class D { }
1514
}
1615

1716
class C extends getSomething()<number, string> {
18-
~
19-
!!! error TS4093: 'extends' clause of exported class 'C' refers to a type whose name cannot be referenced.
2017
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2118
!!! error TS2315: Type 'D' is not generic.
19+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20+
!!! error TS4020: 'extends' clause of exported class 'C' has or is using private name 'D'.
2221

2322
}
2423

2524
class C2 extends SomeUndefinedFunction()<number, string> {
26-
~~
27-
!!! error TS4093: 'extends' clause of exported class 'C2' refers to a type whose name cannot be referenced.
2825
~~~~~~~~~~~~~~~~~~~~~
2926
!!! error TS2304: Cannot find name 'SomeUndefinedFunction'.
3027

tests/baselines/reference/exportClassExtendingIntersection.errors.txt

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

tests/baselines/reference/exportClassExtendingIntersection.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,4 +111,11 @@ export interface MyMixin {
111111
mixinProperty: string;
112112
}
113113
export declare function MyMixin<T extends Constructor<MyBaseClass<any>>>(base: T): T & Constructor<MyMixin>;
114+
//// [FinalClass.d.ts]
115+
import { MyBaseClass } from './BaseClass';
116+
import { MyMixin } from './MixinClass';
117+
declare var _MyExtendedClass_intersection_base: typeof MyBaseClass & (new (...args: any[]) => MyMixin);
118+
export declare class MyExtendedClass extends _MyExtendedClass_intersection_base<string> {
119+
extendedClassProperty: number;
120+
}
114121
//// [Main.d.ts]
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
=== tests/cases/compiler/BaseClass.ts ===
2+
export type Constructor<T> = new (...args: any[]) => T;
3+
>Constructor : Symbol(Constructor, Decl(BaseClass.ts, 0, 0))
4+
>T : Symbol(T, Decl(BaseClass.ts, 0, 24))
5+
>args : Symbol(args, Decl(BaseClass.ts, 0, 34))
6+
>T : Symbol(T, Decl(BaseClass.ts, 0, 24))
7+
8+
export class MyBaseClass<T> {
9+
>MyBaseClass : Symbol(MyBaseClass, Decl(BaseClass.ts, 0, 55))
10+
>T : Symbol(T, Decl(BaseClass.ts, 2, 25))
11+
12+
baseProperty: string;
13+
>baseProperty : Symbol(MyBaseClass.baseProperty, Decl(BaseClass.ts, 2, 29))
14+
15+
constructor(value: T) {}
16+
>value : Symbol(value, Decl(BaseClass.ts, 4, 16))
17+
>T : Symbol(T, Decl(BaseClass.ts, 2, 25))
18+
}
19+
=== tests/cases/compiler/MixinClass.ts ===
20+
import { Constructor, MyBaseClass } from './BaseClass';
21+
>Constructor : Symbol(Constructor, Decl(MixinClass.ts, 0, 8))
22+
>MyBaseClass : Symbol(MyBaseClass, Decl(MixinClass.ts, 0, 21))
23+
24+
export interface MyMixin {
25+
>MyMixin : Symbol(MyMixin, Decl(MixinClass.ts, 0, 55), Decl(MixinClass.ts, 4, 1))
26+
27+
mixinProperty: string;
28+
>mixinProperty : Symbol(MyMixin.mixinProperty, Decl(MixinClass.ts, 2, 26))
29+
}
30+
31+
export function MyMixin<T extends Constructor<MyBaseClass<any>>>(base: T): T & Constructor<MyMixin> {
32+
>MyMixin : Symbol(MyMixin, Decl(MixinClass.ts, 0, 55), Decl(MixinClass.ts, 4, 1))
33+
>T : Symbol(T, Decl(MixinClass.ts, 6, 24))
34+
>Constructor : Symbol(Constructor, Decl(MixinClass.ts, 0, 8))
35+
>MyBaseClass : Symbol(MyBaseClass, Decl(MixinClass.ts, 0, 21))
36+
>base : Symbol(base, Decl(MixinClass.ts, 6, 65))
37+
>T : Symbol(T, Decl(MixinClass.ts, 6, 24))
38+
>T : Symbol(T, Decl(MixinClass.ts, 6, 24))
39+
>Constructor : Symbol(Constructor, Decl(MixinClass.ts, 0, 8))
40+
>MyMixin : Symbol(MyMixin, Decl(MixinClass.ts, 0, 55), Decl(MixinClass.ts, 4, 1))
41+
42+
return class extends base {
43+
>base : Symbol(base, Decl(MixinClass.ts, 6, 65))
44+
45+
mixinProperty: string;
46+
>mixinProperty : Symbol((Anonymous class).mixinProperty, Decl(MixinClass.ts, 7, 31))
47+
}
48+
}
49+
=== tests/cases/compiler/FinalClass.ts ===
50+
import { MyBaseClass } from './BaseClass';
51+
>MyBaseClass : Symbol(MyBaseClass, Decl(FinalClass.ts, 0, 8))
52+
53+
import { MyMixin } from './MixinClass';
54+
>MyMixin : Symbol(MyMixin, Decl(FinalClass.ts, 1, 8))
55+
56+
export class MyExtendedClass extends MyMixin(MyBaseClass)<string> {
57+
>MyExtendedClass : Symbol(MyExtendedClass, Decl(FinalClass.ts, 1, 39))
58+
>MyMixin : Symbol(MyMixin, Decl(FinalClass.ts, 1, 8))
59+
>MyBaseClass : Symbol(MyBaseClass, Decl(FinalClass.ts, 0, 8))
60+
61+
extendedClassProperty: number;
62+
>extendedClassProperty : Symbol(MyExtendedClass.extendedClassProperty, Decl(FinalClass.ts, 3, 67))
63+
}
64+
=== tests/cases/compiler/Main.ts ===
65+
import { MyExtendedClass } from './FinalClass';
66+
>MyExtendedClass : Symbol(MyExtendedClass, Decl(Main.ts, 0, 8))
67+
68+
import { MyMixin } from './MixinClass';
69+
>MyMixin : Symbol(MyMixin, Decl(Main.ts, 1, 8))
70+
71+
const myExtendedClass = new MyExtendedClass('string');
72+
>myExtendedClass : Symbol(myExtendedClass, Decl(Main.ts, 3, 5))
73+
>MyExtendedClass : Symbol(MyExtendedClass, Decl(Main.ts, 0, 8))
74+
75+
const AnotherMixedClass = MyMixin(MyExtendedClass);
76+
>AnotherMixedClass : Symbol(AnotherMixedClass, Decl(Main.ts, 5, 5))
77+
>MyMixin : Symbol(MyMixin, Decl(Main.ts, 1, 8))
78+
>MyExtendedClass : Symbol(MyExtendedClass, Decl(Main.ts, 0, 8))
79+
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
=== tests/cases/compiler/BaseClass.ts ===
2+
export type Constructor<T> = new (...args: any[]) => T;
3+
>Constructor : Constructor<T>
4+
>T : T
5+
>args : any[]
6+
>T : T
7+
8+
export class MyBaseClass<T> {
9+
>MyBaseClass : MyBaseClass<T>
10+
>T : T
11+
12+
baseProperty: string;
13+
>baseProperty : string
14+
15+
constructor(value: T) {}
16+
>value : T
17+
>T : T
18+
}
19+
=== tests/cases/compiler/MixinClass.ts ===
20+
import { Constructor, MyBaseClass } from './BaseClass';
21+
>Constructor : any
22+
>MyBaseClass : typeof MyBaseClass
23+
24+
export interface MyMixin {
25+
>MyMixin : MyMixin
26+
27+
mixinProperty: string;
28+
>mixinProperty : string
29+
}
30+
31+
export function MyMixin<T extends Constructor<MyBaseClass<any>>>(base: T): T & Constructor<MyMixin> {
32+
>MyMixin : <T extends Constructor<MyBaseClass<any>>>(base: T) => T & Constructor<MyMixin>
33+
>T : T
34+
>Constructor : Constructor<T>
35+
>MyBaseClass : MyBaseClass<T>
36+
>base : T
37+
>T : T
38+
>T : T
39+
>Constructor : Constructor<T>
40+
>MyMixin : MyMixin
41+
42+
return class extends base {
43+
>class extends base { mixinProperty: string; } : { new (...args: any[]): (Anonymous class); prototype: MyMixin<any>.(Anonymous class); } & T
44+
>base : MyBaseClass<any>
45+
46+
mixinProperty: string;
47+
>mixinProperty : string
48+
}
49+
}
50+
=== tests/cases/compiler/FinalClass.ts ===
51+
import { MyBaseClass } from './BaseClass';
52+
>MyBaseClass : typeof MyBaseClass
53+
54+
import { MyMixin } from './MixinClass';
55+
>MyMixin : <T extends new (...args: any[]) => MyBaseClass<any>>(base: T) => T & (new (...args: any[]) => MyMixin)
56+
57+
export class MyExtendedClass extends MyMixin(MyBaseClass)<string> {
58+
>MyExtendedClass : MyExtendedClass
59+
>MyMixin(MyBaseClass) : MyBaseClass<string> & MyMixin
60+
>MyMixin : <T extends new (...args: any[]) => MyBaseClass<any>>(base: T) => T & (new (...args: any[]) => MyMixin)
61+
>MyBaseClass : typeof MyBaseClass
62+
63+
extendedClassProperty: number;
64+
>extendedClassProperty : number
65+
}
66+
=== tests/cases/compiler/Main.ts ===
67+
import { MyExtendedClass } from './FinalClass';
68+
>MyExtendedClass : typeof MyExtendedClass
69+
70+
import { MyMixin } from './MixinClass';
71+
>MyMixin : <T extends new (...args: any[]) => MyBaseClass<any>>(base: T) => T & (new (...args: any[]) => MyMixin)
72+
73+
const myExtendedClass = new MyExtendedClass('string');
74+
>myExtendedClass : MyExtendedClass
75+
>new MyExtendedClass('string') : MyExtendedClass
76+
>MyExtendedClass : typeof MyExtendedClass
77+
>'string' : "string"
78+
79+
const AnotherMixedClass = MyMixin(MyExtendedClass);
80+
>AnotherMixedClass : typeof MyExtendedClass & (new (...args: any[]) => MyMixin)
81+
>MyMixin(MyExtendedClass) : typeof MyExtendedClass & (new (...args: any[]) => MyMixin)
82+
>MyMixin : <T extends new (...args: any[]) => MyBaseClass<any>>(base: T) => T & (new (...args: any[]) => MyMixin)
83+
>MyExtendedClass : typeof MyExtendedClass
84+

tests/baselines/reference/mixinAccessModifiers.errors.txt

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,19 @@ tests/cases/conformance/classes/mixinAccessModifiers.ts(50,4): error TS2445: Pro
55
tests/cases/conformance/classes/mixinAccessModifiers.ts(65,7): error TS2415: Class 'C1' incorrectly extends base class 'Private & Private2'.
66
Type 'C1' is not assignable to type 'Private'.
77
Property 'p' has conflicting declarations and is inaccessible in type 'C1'.
8-
tests/cases/conformance/classes/mixinAccessModifiers.ts(65,7): error TS4093: 'extends' clause of exported class 'C1' refers to a type whose name cannot be referenced.
98
tests/cases/conformance/classes/mixinAccessModifiers.ts(66,7): error TS2415: Class 'C2' incorrectly extends base class 'Private & Protected'.
109
Type 'C2' is not assignable to type 'Private'.
1110
Property 'p' has conflicting declarations and is inaccessible in type 'C2'.
12-
tests/cases/conformance/classes/mixinAccessModifiers.ts(66,7): error TS4093: 'extends' clause of exported class 'C2' refers to a type whose name cannot be referenced.
1311
tests/cases/conformance/classes/mixinAccessModifiers.ts(67,7): error TS2415: Class 'C3' incorrectly extends base class 'Private & Public'.
1412
Type 'C3' is not assignable to type 'Private'.
1513
Property 'p' has conflicting declarations and is inaccessible in type 'C3'.
16-
tests/cases/conformance/classes/mixinAccessModifiers.ts(67,7): error TS4093: 'extends' clause of exported class 'C3' refers to a type whose name cannot be referenced.
17-
tests/cases/conformance/classes/mixinAccessModifiers.ts(69,7): error TS4093: 'extends' clause of exported class 'C4' refers to a type whose name cannot be referenced.
18-
tests/cases/conformance/classes/mixinAccessModifiers.ts(82,7): error TS4093: 'extends' clause of exported class 'C5' refers to a type whose name cannot be referenced.
1914
tests/cases/conformance/classes/mixinAccessModifiers.ts(84,6): error TS2445: Property 'p' is protected and only accessible within class 'C4' and its subclasses.
2015
tests/cases/conformance/classes/mixinAccessModifiers.ts(89,6): error TS2445: Property 's' is protected and only accessible within class 'typeof C4' and its subclasses.
21-
tests/cases/conformance/classes/mixinAccessModifiers.ts(95,7): error TS4093: 'extends' clause of exported class 'C6' refers to a type whose name cannot be referenced.
2216
tests/cases/conformance/classes/mixinAccessModifiers.ts(97,6): error TS2445: Property 'p' is protected and only accessible within class 'C4' and its subclasses.
2317
tests/cases/conformance/classes/mixinAccessModifiers.ts(102,6): error TS2445: Property 's' is protected and only accessible within class 'typeof C4' and its subclasses.
2418

2519

26-
==== tests/cases/conformance/classes/mixinAccessModifiers.ts (17 errors) ====
20+
==== tests/cases/conformance/classes/mixinAccessModifiers.ts (11 errors) ====
2721
type Constructable = new (...args: any[]) => object;
2822

2923
class Private {
@@ -101,26 +95,18 @@ tests/cases/conformance/classes/mixinAccessModifiers.ts(102,6): error TS2445: Pr
10195
!!! error TS2415: Class 'C1' incorrectly extends base class 'Private & Private2'.
10296
!!! error TS2415: Type 'C1' is not assignable to type 'Private'.
10397
!!! error TS2415: Property 'p' has conflicting declarations and is inaccessible in type 'C1'.
104-
~~
105-
!!! error TS4093: 'extends' clause of exported class 'C1' refers to a type whose name cannot be referenced.
10698
class C2 extends Mix(Private, Protected) {}
10799
~~
108100
!!! error TS2415: Class 'C2' incorrectly extends base class 'Private & Protected'.
109101
!!! error TS2415: Type 'C2' is not assignable to type 'Private'.
110102
!!! error TS2415: Property 'p' has conflicting declarations and is inaccessible in type 'C2'.
111-
~~
112-
!!! error TS4093: 'extends' clause of exported class 'C2' refers to a type whose name cannot be referenced.
113103
class C3 extends Mix(Private, Public) {}
114104
~~
115105
!!! error TS2415: Class 'C3' incorrectly extends base class 'Private & Public'.
116106
!!! error TS2415: Type 'C3' is not assignable to type 'Private'.
117107
!!! error TS2415: Property 'p' has conflicting declarations and is inaccessible in type 'C3'.
118-
~~
119-
!!! error TS4093: 'extends' clause of exported class 'C3' refers to a type whose name cannot be referenced.
120108

121109
class C4 extends Mix(Protected, Protected2) {
122-
~~
123-
!!! error TS4093: 'extends' clause of exported class 'C4' refers to a type whose name cannot be referenced.
124110
f(c4: C4, c5: C5, c6: C6) {
125111
c4.p;
126112
c5.p;
@@ -134,8 +120,6 @@ tests/cases/conformance/classes/mixinAccessModifiers.ts(102,6): error TS2445: Pr
134120
}
135121

136122
class C5 extends Mix(Protected, Public) {
137-
~~
138-
!!! error TS4093: 'extends' clause of exported class 'C5' refers to a type whose name cannot be referenced.
139123
f(c4: C4, c5: C5, c6: C6) {
140124
c4.p; // Error, not in class deriving from Protected2
141125
~
@@ -153,8 +137,6 @@ tests/cases/conformance/classes/mixinAccessModifiers.ts(102,6): error TS2445: Pr
153137
}
154138

155139
class C6 extends Mix(Public, Public2) {
156-
~~
157-
!!! error TS4093: 'extends' clause of exported class 'C6' refers to a type whose name cannot be referenced.
158140
f(c4: C4, c5: C5, c6: C6) {
159141
c4.p; // Error, not in class deriving from Protected2
160142
~

0 commit comments

Comments
 (0)