mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
88d31a45dd
Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: DanielRosenwasser <[email protected]>
36 lines
924 B
TypeScript
36 lines
924 B
TypeScript
// @declaration: true
|
|
// @target: esnext
|
|
|
|
// Regression test: when a class extends a mixin that returns an intersection,
|
|
// the class's anonymous constructor type inherits static accessor properties from the
|
|
// intersection. These synthetic properties can have a nil parent symbol when the
|
|
// constituent accessor declarations differ. Declaration emit must not crash when
|
|
// serializing these properties.
|
|
|
|
function mix<T extends new (...args: any[]) => any, U extends new (...args: any[]) => any>(
|
|
base1: T, base2: U
|
|
): T & U {
|
|
return null as any;
|
|
}
|
|
|
|
class A {
|
|
static get shared(): number { return 1; }
|
|
static set shared(v: number) { }
|
|
x: string = "";
|
|
}
|
|
|
|
class B {
|
|
static get shared(): number { return 2; }
|
|
static set shared(v: number) { }
|
|
y: number = 0;
|
|
}
|
|
|
|
function make() {
|
|
class C extends mix(A, B) {
|
|
z: boolean = true;
|
|
}
|
|
return C;
|
|
}
|
|
|
|
export const MixedClass = make();
|