Skip to content

Commit d29a82a

Browse files
committed
add extra test case
1 parent e38b30d commit d29a82a

4 files changed

Lines changed: 187 additions & 0 deletions

File tree

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
//// [tests/cases/conformance/classes/mixinAccessors5.ts] ////
2+
3+
//// [mixinAccessors5.ts]
4+
// https://github.com/microsoft/TypeScript/issues/61967
5+
6+
declare function basicMixin<T extends object, U extends object>(
7+
t: T,
8+
u: U,
9+
): T & U;
10+
11+
declare class GetterA {
12+
constructor(...args: any[]);
13+
14+
get inCompendium(): boolean;
15+
}
16+
17+
declare class GetterB {
18+
constructor(...args: any[]);
19+
20+
get inCompendium(): boolean;
21+
}
22+
23+
declare class TestB extends basicMixin(GetterA, GetterB) {
24+
override get inCompendium(): boolean;
25+
}
26+
27+
28+
//// [mixinAccessors5.js]
29+
"use strict";
30+
// https://github.com/microsoft/TypeScript/issues/61967
31+
32+
33+
//// [mixinAccessors5.d.ts]
34+
declare function basicMixin<T extends object, U extends object>(t: T, u: U): T & U;
35+
declare class GetterA {
36+
constructor(...args: any[]);
37+
get inCompendium(): boolean;
38+
}
39+
declare class GetterB {
40+
constructor(...args: any[]);
41+
get inCompendium(): boolean;
42+
}
43+
declare const TestB_base: typeof GetterA & typeof GetterB;
44+
declare class TestB extends TestB_base {
45+
get inCompendium(): boolean;
46+
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
//// [tests/cases/conformance/classes/mixinAccessors5.ts] ////
2+
3+
=== mixinAccessors5.ts ===
4+
// https://github.com/microsoft/TypeScript/issues/61967
5+
6+
declare function basicMixin<T extends object, U extends object>(
7+
>basicMixin : Symbol(basicMixin, Decl(mixinAccessors5.ts, 0, 0))
8+
>T : Symbol(T, Decl(mixinAccessors5.ts, 2, 28))
9+
>U : Symbol(U, Decl(mixinAccessors5.ts, 2, 45))
10+
11+
t: T,
12+
>t : Symbol(t, Decl(mixinAccessors5.ts, 2, 64))
13+
>T : Symbol(T, Decl(mixinAccessors5.ts, 2, 28))
14+
15+
u: U,
16+
>u : Symbol(u, Decl(mixinAccessors5.ts, 3, 7))
17+
>U : Symbol(U, Decl(mixinAccessors5.ts, 2, 45))
18+
19+
): T & U;
20+
>T : Symbol(T, Decl(mixinAccessors5.ts, 2, 28))
21+
>U : Symbol(U, Decl(mixinAccessors5.ts, 2, 45))
22+
23+
declare class GetterA {
24+
>GetterA : Symbol(GetterA, Decl(mixinAccessors5.ts, 5, 9))
25+
26+
constructor(...args: any[]);
27+
>args : Symbol(args, Decl(mixinAccessors5.ts, 8, 14))
28+
29+
get inCompendium(): boolean;
30+
>inCompendium : Symbol(GetterA.inCompendium, Decl(mixinAccessors5.ts, 8, 30))
31+
}
32+
33+
declare class GetterB {
34+
>GetterB : Symbol(GetterB, Decl(mixinAccessors5.ts, 11, 1))
35+
36+
constructor(...args: any[]);
37+
>args : Symbol(args, Decl(mixinAccessors5.ts, 14, 14))
38+
39+
get inCompendium(): boolean;
40+
>inCompendium : Symbol(GetterB.inCompendium, Decl(mixinAccessors5.ts, 14, 30))
41+
}
42+
43+
declare class TestB extends basicMixin(GetterA, GetterB) {
44+
>TestB : Symbol(TestB, Decl(mixinAccessors5.ts, 17, 1))
45+
>basicMixin : Symbol(basicMixin, Decl(mixinAccessors5.ts, 0, 0))
46+
>GetterA : Symbol(GetterA, Decl(mixinAccessors5.ts, 5, 9))
47+
>GetterB : Symbol(GetterB, Decl(mixinAccessors5.ts, 11, 1))
48+
49+
override get inCompendium(): boolean;
50+
>inCompendium : Symbol(TestB.inCompendium, Decl(mixinAccessors5.ts, 19, 58))
51+
}
52+
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
//// [tests/cases/conformance/classes/mixinAccessors5.ts] ////
2+
3+
=== mixinAccessors5.ts ===
4+
// https://github.com/microsoft/TypeScript/issues/61967
5+
6+
declare function basicMixin<T extends object, U extends object>(
7+
>basicMixin : <T extends object, U extends object>(t: T, u: U) => T & U
8+
> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^
9+
10+
t: T,
11+
>t : T
12+
> : ^
13+
14+
u: U,
15+
>u : U
16+
> : ^
17+
18+
): T & U;
19+
20+
declare class GetterA {
21+
>GetterA : GetterA
22+
> : ^^^^^^^
23+
24+
constructor(...args: any[]);
25+
>args : any[]
26+
> : ^^^^^
27+
28+
get inCompendium(): boolean;
29+
>inCompendium : boolean
30+
> : ^^^^^^^
31+
}
32+
33+
declare class GetterB {
34+
>GetterB : GetterB
35+
> : ^^^^^^^
36+
37+
constructor(...args: any[]);
38+
>args : any[]
39+
> : ^^^^^
40+
41+
get inCompendium(): boolean;
42+
>inCompendium : boolean
43+
> : ^^^^^^^
44+
}
45+
46+
declare class TestB extends basicMixin(GetterA, GetterB) {
47+
>TestB : TestB
48+
> : ^^^^^
49+
>basicMixin(GetterA, GetterB) : GetterA & GetterB
50+
> : ^^^^^^^^^^^^^^^^^
51+
>basicMixin : <T extends object, U extends object>(t: T, u: U) => T & U
52+
> : ^ ^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^ ^^ ^^ ^^^^^
53+
>GetterA : typeof GetterA
54+
> : ^^^^^^^^^^^^^^
55+
>GetterB : typeof GetterB
56+
> : ^^^^^^^^^^^^^^
57+
58+
override get inCompendium(): boolean;
59+
>inCompendium : boolean
60+
> : ^^^^^^^
61+
}
62+
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// @strict: true
2+
// @target: esnext
3+
// @declaration: true
4+
5+
// https://github.com/microsoft/TypeScript/issues/61967
6+
7+
declare function basicMixin<T extends object, U extends object>(
8+
t: T,
9+
u: U,
10+
): T & U;
11+
12+
declare class GetterA {
13+
constructor(...args: any[]);
14+
15+
get inCompendium(): boolean;
16+
}
17+
18+
declare class GetterB {
19+
constructor(...args: any[]);
20+
21+
get inCompendium(): boolean;
22+
}
23+
24+
declare class TestB extends basicMixin(GetterA, GetterB) {
25+
override get inCompendium(): boolean;
26+
}
27+

0 commit comments

Comments
 (0)