diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 027007fb15b62..c232e71a659c5 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -10540,7 +10540,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker { // the type of which is an instantiation of the class type with type Any supplied as a type argument for each type parameter. // It is an error to explicitly declare a static property member with the name 'prototype'. const classType = getDeclaredTypeOfSymbol(getParentOfSymbol(prototype)!) as InterfaceType; - return classType.typeParameters ? createTypeReference(classType as GenericType, map(classType.typeParameters, _ => anyType)) : classType; + return classType.localTypeParameters ? createTypeReference(classType as GenericType, concatenate(classType.outerTypeParameters, map(classType.localTypeParameters, _ => anyType))) : classType; } // Return the type of the given property in the given type, or undefined if no such property exists diff --git a/tests/baselines/reference/accessorsOverrideProperty9.types b/tests/baselines/reference/accessorsOverrideProperty9.types index 9f4156dfb087f..b690d779ccc9b 100644 --- a/tests/baselines/reference/accessorsOverrideProperty9.types +++ b/tests/baselines/reference/accessorsOverrideProperty9.types @@ -91,8 +91,8 @@ function ApiItemContainerMixin( } return MixedClass; ->MixedClass : ((abstract new (...args: any[]) => MixedClass) & { prototype: ApiItemContainerMixin.MixedClass; }) & TBaseClass -> : ^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>MixedClass : ((abstract new (...args: any[]) => MixedClass) & { prototype: MixedClass; }) & TBaseClass +> : ^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ } // Subclass inheriting from mixin diff --git a/tests/baselines/reference/amdDeclarationEmitNoExtraDeclare.types b/tests/baselines/reference/amdDeclarationEmitNoExtraDeclare.types index 0435ab5bcd405..ee4709e35e20d 100644 --- a/tests/baselines/reference/amdDeclarationEmitNoExtraDeclare.types +++ b/tests/baselines/reference/amdDeclarationEmitNoExtraDeclare.types @@ -35,8 +35,8 @@ export function Configurable>(base: T): T { > : ^ return class extends base { ->class extends base { constructor(...args: any[]) { super(...args); } } : { new (...args: any[]): (Anonymous class); prototype: Configurable.(Anonymous class); } & T -> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>class extends base { constructor(...args: any[]) { super(...args); } } : { new (...args: any[]): (Anonymous class); prototype: (Anonymous class); } & T +> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >base : {} > : ^^ diff --git a/tests/baselines/reference/anonClassDeclarationEmitIsAnon.types b/tests/baselines/reference/anonClassDeclarationEmitIsAnon.types index 988cb634458ab..5fc7876b649f5 100644 --- a/tests/baselines/reference/anonClassDeclarationEmitIsAnon.types +++ b/tests/baselines/reference/anonClassDeclarationEmitIsAnon.types @@ -29,14 +29,14 @@ export type Constructor = new (...args: any[]) => T; > : ^^^^^ export function Timestamped(Base: TBase) { ->Timestamped : >(Base: TBase) => { new (...args: any[]): (Anonymous class); prototype: Timestamped.(Anonymous class); } & TBase -> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Timestamped : >(Base: TBase) => { new (...args: any[]): (Anonymous class); prototype: (Anonymous class); } & TBase +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >Base : TBase > : ^^^^^ return class extends Base { ->class extends Base { timestamp = Date.now(); } : { new (...args: any[]): (Anonymous class); prototype: Timestamped.(Anonymous class); } & TBase -> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>class extends Base { timestamp = Date.now(); } : { new (...args: any[]): (Anonymous class); prototype: (Anonymous class); } & TBase +> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >Base : {} > : ^^ @@ -59,8 +59,8 @@ export function Timestamped(Base: TBase) { import { wrapClass, Timestamped } from "./wrapClass"; >wrapClass : (param: any) => typeof Wrapped > : ^ ^^ ^^^^^^^^^^^^^^^^^^^ ->Timestamped : >(Base: TBase) => { new (...args: any[]): (Anonymous class); prototype: Timestamped.(Anonymous class); } & TBase -> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Timestamped : >(Base: TBase) => { new (...args: any[]): (Anonymous class); prototype: (Anonymous class); } & TBase +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ export default wrapClass(0); >wrapClass(0) : typeof Wrapped @@ -88,8 +88,8 @@ export class TimestampedUser extends Timestamped(User) { > : ^^^^^^^^^^^^^^^ >Timestamped(User) : Timestamped.(Anonymous class) & User > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->Timestamped : >(Base: TBase) => { new (...args: any[]): (Anonymous class); prototype: Timestamped.(Anonymous class); } & TBase -> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Timestamped : >(Base: TBase) => { new (...args: any[]): (Anonymous class); prototype: (Anonymous class); } & TBase +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >User : typeof User > : ^^^^^^^^^^^ @@ -97,7 +97,7 @@ export class TimestampedUser extends Timestamped(User) { super(); >super() : void > : ^^^^ ->super : { new (...args: any[]): Timestamped.(Anonymous class); prototype: Timestamped.(Anonymous class); } & typeof User -> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>super : { new (...args: any[]): Timestamped.(Anonymous class); prototype: Timestamped.(Anonymous class); } & typeof User +> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ } } diff --git a/tests/baselines/reference/baseConstraintOfDecorator.types b/tests/baselines/reference/baseConstraintOfDecorator.types index 8988c1951436a..70c58509ad684 100644 --- a/tests/baselines/reference/baseConstraintOfDecorator.types +++ b/tests/baselines/reference/baseConstraintOfDecorator.types @@ -69,10 +69,10 @@ export function classExtender2 MyCl > : ^^^^^ return class decoratorFunc extends superClass { ->class decoratorFunc extends superClass { constructor(...args: any[]) { super(...args); _instanceModifier(this, args); } } : { new (...args: any[]): decoratorFunc; prototype: classExtender2.decoratorFunc; } & TFunction -> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->decoratorFunc : { new (...args: any[]): decoratorFunc; prototype: classExtender2.decoratorFunc; } & TFunction -> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>class decoratorFunc extends superClass { constructor(...args: any[]) { super(...args); _instanceModifier(this, args); } } : { new (...args: any[]): decoratorFunc; prototype: decoratorFunc; } & TFunction +> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>decoratorFunc : { new (...args: any[]): decoratorFunc; prototype: decoratorFunc; } & TFunction +> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >superClass : MyClass > : ^^^^^^^ diff --git a/tests/baselines/reference/declarationEmitLocalClassDeclarationMixin.types b/tests/baselines/reference/declarationEmitLocalClassDeclarationMixin.types index c350d0ce11bde..1741cd4da47b1 100644 --- a/tests/baselines/reference/declarationEmitLocalClassDeclarationMixin.types +++ b/tests/baselines/reference/declarationEmitLocalClassDeclarationMixin.types @@ -6,8 +6,8 @@ interface Constructor { new (...args: any[]): C; } > : ^^^^^ function mixin>(Base: B) { ->mixin : >(Base: B) => { new (...args: any[]): PrivateMixed; prototype: mixin.PrivateMixed; } & B -> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>mixin : >(Base: B) => { new (...args: any[]): PrivateMixed; prototype: PrivateMixed; } & B +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >Base : B > : ^ @@ -24,8 +24,8 @@ function mixin>(Base: B) { > : ^ } return PrivateMixed; ->PrivateMixed : { new (...args: any[]): PrivateMixed; prototype: mixin.PrivateMixed; } & B -> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>PrivateMixed : { new (...args: any[]): PrivateMixed; prototype: PrivateMixed; } & B +> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ } export class Unmixed { @@ -40,18 +40,18 @@ export class Unmixed { } export const Mixed = mixin(Unmixed); ->Mixed : { new (...args: any[]): mixin.PrivateMixed; prototype: mixin.PrivateMixed; } & typeof Unmixed -> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->mixin(Unmixed) : { new (...args: any[]): mixin.PrivateMixed; prototype: mixin.PrivateMixed; } & typeof Unmixed -> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->mixin : >(Base: B) => { new (...args: any[]): PrivateMixed; prototype: mixin.PrivateMixed; } & B -> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Mixed : { new (...args: any[]): mixin.PrivateMixed; prototype: mixin.PrivateMixed; } & typeof Unmixed +> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>mixin(Unmixed) : { new (...args: any[]): mixin.PrivateMixed; prototype: mixin.PrivateMixed; } & typeof Unmixed +> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>mixin : >(Base: B) => { new (...args: any[]): PrivateMixed; prototype: PrivateMixed; } & B +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >Unmixed : typeof Unmixed > : ^^^^^^^^^^^^^^ function Filter>(ctor: C) { ->Filter : >(ctor: C) => ((abstract new (...args: any[]) => FilterMixin) & { prototype: Filter.FilterMixin; }) & C -> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Filter : >(ctor: C) => ((abstract new (...args: any[]) => FilterMixin) & { prototype: FilterMixin; }) & C +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >ctor : C > : ^ @@ -75,8 +75,8 @@ function Filter>(ctor: C) { > : ^^ } return FilterMixin; ->FilterMixin : ((abstract new (...args: any[]) => FilterMixin) & { prototype: Filter.FilterMixin; }) & C -> : ^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>FilterMixin : ((abstract new (...args: any[]) => FilterMixin) & { prototype: FilterMixin; }) & C +> : ^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ } export class FilteredThing extends Filter(Unmixed) { @@ -84,8 +84,8 @@ export class FilteredThing extends Filter(Unmixed) { > : ^^^^^^^^^^^^^ >Filter(Unmixed) : Filter.FilterMixin & Unmixed > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->Filter : >(ctor: C) => ((abstract new (...args: any[]) => FilterMixin) & { prototype: Filter.FilterMixin; }) & C -> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Filter : >(ctor: C) => ((abstract new (...args: any[]) => FilterMixin) & { prototype: FilterMixin; }) & C +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >Unmixed : typeof Unmixed > : ^^^^^^^^^^^^^^ diff --git a/tests/baselines/reference/declarationEmitPrivateNameCausesError.types b/tests/baselines/reference/declarationEmitPrivateNameCausesError.types index 8cb9af4817cd1..16120ec96336f 100644 --- a/tests/baselines/reference/declarationEmitPrivateNameCausesError.types +++ b/tests/baselines/reference/declarationEmitPrivateNameCausesError.types @@ -11,16 +11,16 @@ const IGNORE_EXTRA_VARIABLES = Symbol(); //Notice how this is unexported //This is exported export function ignoreExtraVariables (ctor : CtorT) { ->ignoreExtraVariables : {}>(ctor: CtorT) => { new (...args: any[]): (Anonymous class); prototype: ignoreExtraVariables.(Anonymous class); } & CtorT -> : ^ ^^^^^^^^^^^^^^^^^ ^^ ^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>ignoreExtraVariables : {}>(ctor: CtorT) => { new (...args: any[]): (Anonymous class); prototype: (Anonymous class); } & CtorT +> : ^ ^^^^^^^^^^^^^^^^^ ^^ ^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >args : any[] > : ^^^^^ >ctor : CtorT > : ^^^^^ return class extends ctor { ->class extends ctor { [IGNORE_EXTRA_VARIABLES] = true; //An unexported constant is used } : { new (...args: any[]): (Anonymous class); prototype: ignoreExtraVariables.(Anonymous class); } & CtorT -> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>class extends ctor { [IGNORE_EXTRA_VARIABLES] = true; //An unexported constant is used } : { new (...args: any[]): (Anonymous class); prototype: (Anonymous class); } & CtorT +> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >ctor : {} > : ^^ diff --git a/tests/baselines/reference/doubleMixinConditionalTypeBaseClassWorks.types b/tests/baselines/reference/doubleMixinConditionalTypeBaseClassWorks.types index 728c283f233c8..ee04961195e26 100644 --- a/tests/baselines/reference/doubleMixinConditionalTypeBaseClassWorks.types +++ b/tests/baselines/reference/doubleMixinConditionalTypeBaseClassWorks.types @@ -8,50 +8,50 @@ type Constructor = new (...args: any[]) => {}; > : ^^^^^ const Mixin1 = (Base: C) => class extends Base { private _fooPrivate: {}; } ->Mixin1 : (Base: C) => { new (...args: any[]): (Anonymous class); prototype: Mixin1.(Anonymous class); } & C -> : ^ ^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->(Base: C) => class extends Base { private _fooPrivate: {}; } : (Base: C) => { new (...args: any[]): (Anonymous class); prototype: Mixin1.(Anonymous class); } & C -> : ^ ^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Mixin1 : (Base: C) => { new (...args: any[]): (Anonymous class); prototype: (Anonymous class); } & C +> : ^ ^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>(Base: C) => class extends Base { private _fooPrivate: {}; } : (Base: C) => { new (...args: any[]): (Anonymous class); prototype: (Anonymous class); } & C +> : ^ ^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >Base : C > : ^ ->class extends Base { private _fooPrivate: {}; } : { new (...args: any[]): (Anonymous class); prototype: Mixin1.(Anonymous class); } & C -> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>class extends Base { private _fooPrivate: {}; } : { new (...args: any[]): (Anonymous class); prototype: (Anonymous class); } & C +> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >Base : {} > : ^^ >_fooPrivate : {} > : ^^ type FooConstructor = typeof Mixin1 extends (a: Constructor) => infer Cls ? Cls : never; ->FooConstructor : { new (...args: any[]): Mixin1.(Anonymous class); prototype: Mixin1.(Anonymous class); } & Constructor -> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->Mixin1 : (Base: C) => { new (...args: any[]): (Anonymous class); prototype: Mixin1.(Anonymous class); } & C -> : ^ ^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>FooConstructor : { new (...args: any[]): Mixin1.(Anonymous class); prototype: Mixin1.(Anonymous class); } & Constructor +> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Mixin1 : (Base: C) => { new (...args: any[]): (Anonymous class); prototype: (Anonymous class); } & C +> : ^ ^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >a : Constructor > : ^^^^^^^^^^^ const Mixin2 = (Base: C) => class extends Base {}; ->Mixin2 : .(Anonymous class); prototype: Mixin1.(Anonymous class); } & Constructor>(Base: C) => { new (...args: any[]): (Anonymous class); prototype: Mixin2.(Anonymous class); } & C -> : ^ ^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->(Base: C) => class extends Base {} : .(Anonymous class); prototype: Mixin1.(Anonymous class); } & Constructor>(Base: C) => { new (...args: any[]): (Anonymous class); prototype: Mixin2.(Anonymous class); } & C -> : ^ ^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Mixin2 : .(Anonymous class); prototype: Mixin1.(Anonymous class); } & Constructor>(Base: C) => { new (...args: any[]): (Anonymous class); prototype: (Anonymous class); } & C +> : ^ ^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>(Base: C) => class extends Base {} : .(Anonymous class); prototype: Mixin1.(Anonymous class); } & Constructor>(Base: C) => { new (...args: any[]): (Anonymous class); prototype: (Anonymous class); } & C +> : ^ ^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >Base : C > : ^ ->class extends Base {} : { new (...args: any[]): (Anonymous class); prototype: Mixin2.(Anonymous class); } & C -> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>class extends Base {} : { new (...args: any[]): (Anonymous class); prototype: (Anonymous class); } & C +> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >Base : Mixin1.(Anonymous class) > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ class C extends Mixin2(Mixin1(Object)) {} >C : C > : ^ ->Mixin2(Mixin1(Object)) : Mixin2<{ new (...args: any[]): Mixin1.(Anonymous class); prototype: Mixin1.(Anonymous class); } & ObjectConstructor>.(Anonymous class) & Mixin1.(Anonymous class) & Object -> : ^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->Mixin2 : .(Anonymous class); prototype: Mixin1.(Anonymous class); } & Constructor>(Base: C) => { new (...args: any[]): (Anonymous class); prototype: Mixin2.(Anonymous class); } & C -> : ^ ^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->Mixin1(Object) : { new (...args: any[]): Mixin1.(Anonymous class); prototype: Mixin1.(Anonymous class); } & ObjectConstructor -> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->Mixin1 : (Base: C) => { new (...args: any[]): (Anonymous class); prototype: Mixin1.(Anonymous class); } & C -> : ^ ^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Mixin2(Mixin1(Object)) : Mixin2<{ new (...args: any[]): Mixin1.(Anonymous class); prototype: Mixin1.(Anonymous class); } & ObjectConstructor>.(Anonymous class) & Mixin1.(Anonymous class) & Object +> : ^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Mixin2 : .(Anonymous class); prototype: Mixin1.(Anonymous class); } & Constructor>(Base: C) => { new (...args: any[]): (Anonymous class); prototype: (Anonymous class); } & C +> : ^ ^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Mixin1(Object) : { new (...args: any[]): Mixin1.(Anonymous class); prototype: Mixin1.(Anonymous class); } & ObjectConstructor +> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Mixin1 : (Base: C) => { new (...args: any[]): (Anonymous class); prototype: (Anonymous class); } & C +> : ^ ^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >Object : ObjectConstructor > : ^^^^^^^^^^^^^^^^^ diff --git a/tests/baselines/reference/emitClassExpressionInDeclarationFile.types b/tests/baselines/reference/emitClassExpressionInDeclarationFile.types index 9a70c55a7747e..5889886178df8 100644 --- a/tests/baselines/reference/emitClassExpressionInDeclarationFile.types +++ b/tests/baselines/reference/emitClassExpressionInDeclarationFile.types @@ -61,14 +61,14 @@ export type Constructor = new(...args: any[]) => T; > : ^^^^^ export function WithTags>(Base: T) { ->WithTags : >(Base: T) => { new (...args: any[]): (Anonymous class); prototype: WithTags.(Anonymous class); getTags(): void; } & T -> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^ +>WithTags : >(Base: T) => { new (...args: any[]): (Anonymous class); prototype: (Anonymous class); getTags(): void; } & T +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^ >Base : T > : ^ return class extends Base { ->class extends Base { static getTags(): void { } tags(): void { } } : { new (...args: any[]): (Anonymous class); prototype: WithTags.(Anonymous class); getTags(): void; } & T -> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^ +>class extends Base { static getTags(): void { } tags(): void { } } : { new (...args: any[]): (Anonymous class); prototype: (Anonymous class); getTags(): void; } & T +> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^ >Base : FooItem > : ^^^^^^^ @@ -87,8 +87,8 @@ export class Test extends WithTags(FooItem) {} > : ^^^^ >WithTags(FooItem) : WithTags.(Anonymous class) & FooItem > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->WithTags : >(Base: T) => { new (...args: any[]): (Anonymous class); prototype: WithTags.(Anonymous class); getTags(): void; } & T -> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>WithTags : >(Base: T) => { new (...args: any[]): (Anonymous class); prototype: (Anonymous class); getTags(): void; } & T +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >FooItem : typeof FooItem > : ^^^^^^^^^^^^^^ diff --git a/tests/baselines/reference/emitClassExpressionInDeclarationFile2.types b/tests/baselines/reference/emitClassExpressionInDeclarationFile2.types index 6d9550c752f8d..fbc14c9f9a5cd 100644 --- a/tests/baselines/reference/emitClassExpressionInDeclarationFile2.types +++ b/tests/baselines/reference/emitClassExpressionInDeclarationFile2.types @@ -57,14 +57,14 @@ export type Constructor = new(...args: any[]) => T; > : ^^^^^ export function WithTags>(Base: T) { ->WithTags : >(Base: T) => { new (...args: any[]): (Anonymous class); prototype: WithTags.(Anonymous class); getTags(): void; } & T -> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^ +>WithTags : >(Base: T) => { new (...args: any[]): (Anonymous class); prototype: (Anonymous class); getTags(): void; } & T +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^ >Base : T > : ^ return class extends Base { ->class extends Base { static getTags(): void { } tags(): void { } } : { new (...args: any[]): (Anonymous class); prototype: WithTags.(Anonymous class); getTags(): void; } & T -> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^ +>class extends Base { static getTags(): void { } tags(): void { } } : { new (...args: any[]): (Anonymous class); prototype: (Anonymous class); getTags(): void; } & T +> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^ >Base : FooItem > : ^^^^^^^ @@ -83,8 +83,8 @@ export class Test extends WithTags(FooItem) {} > : ^^^^ >WithTags(FooItem) : WithTags.(Anonymous class) & FooItem > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->WithTags : >(Base: T) => { new (...args: any[]): (Anonymous class); prototype: WithTags.(Anonymous class); getTags(): void; } & T -> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>WithTags : >(Base: T) => { new (...args: any[]): (Anonymous class); prototype: (Anonymous class); getTags(): void; } & T +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >FooItem : typeof FooItem > : ^^^^^^^^^^^^^^ diff --git a/tests/baselines/reference/exportClassExtendingIntersection.types b/tests/baselines/reference/exportClassExtendingIntersection.types index d36006d78ee1e..36197d5bfae26 100644 --- a/tests/baselines/reference/exportClassExtendingIntersection.types +++ b/tests/baselines/reference/exportClassExtendingIntersection.types @@ -39,8 +39,8 @@ export function MyMixin>>(base: T): T & C > : ^ return class extends base { ->class extends base { mixinProperty: string; } : { new (...args: any[]): (Anonymous class); prototype: MyMixin.(Anonymous class); } & T -> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>class extends base { mixinProperty: string; } : { new (...args: any[]): (Anonymous class); prototype: (Anonymous class); } & T +> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >base : MyBaseClass > : ^^^^^^^^^^^^^^^^ diff --git a/tests/baselines/reference/mixinAbstractClasses.2.types b/tests/baselines/reference/mixinAbstractClasses.2.types index cde9ab60b7999..a4a48e01f4b25 100644 --- a/tests/baselines/reference/mixinAbstractClasses.2.types +++ b/tests/baselines/reference/mixinAbstractClasses.2.types @@ -30,8 +30,8 @@ function Mixin any>(baseClass: } } return MixinClass; ->MixinClass : { new (...args: any): MixinClass; prototype: Mixin.MixinClass; } & TBaseClass -> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>MixinClass : { new (...args: any): MixinClass; prototype: MixinClass; } & TBaseClass +> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ } abstract class AbstractBase { diff --git a/tests/baselines/reference/mixinAbstractClasses.types b/tests/baselines/reference/mixinAbstractClasses.types index 1027af673b0b0..c96360cbfa4e9 100644 --- a/tests/baselines/reference/mixinAbstractClasses.types +++ b/tests/baselines/reference/mixinAbstractClasses.types @@ -27,8 +27,8 @@ function Mixin any>(baseClass: } } return MixinClass; ->MixinClass : ((abstract new (...args: any) => MixinClass) & { prototype: Mixin.MixinClass; }) & TBaseClass -> : ^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>MixinClass : ((abstract new (...args: any) => MixinClass) & { prototype: MixinClass; }) & TBaseClass +> : ^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ } class ConcreteBase { diff --git a/tests/baselines/reference/mixinAbstractClassesReturnTypeInference.types b/tests/baselines/reference/mixinAbstractClassesReturnTypeInference.types index 0f0c302cb4b9a..ec3b0f55a7a61 100644 --- a/tests/baselines/reference/mixinAbstractClassesReturnTypeInference.types +++ b/tests/baselines/reference/mixinAbstractClassesReturnTypeInference.types @@ -17,8 +17,8 @@ abstract class AbstractBase { } function Mixin2 any>(baseClass: TBase) { ->Mixin2 : any>(baseClass: TBase) => ((abstract new (...args: any[]) => MixinClass) & { prototype: Mixin2.MixinClass; staticMixinMethod(): void; }) & TBase -> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^ +>Mixin2 : any>(baseClass: TBase) => ((abstract new (...args: any[]) => MixinClass) & { prototype: MixinClass; staticMixinMethod(): void; }) & TBase +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^ >args : any[] > : ^^^^^ >baseClass : TBase @@ -41,8 +41,8 @@ function Mixin2 any>(baseClass: T > : ^^^^^^ } return MixinClass; ->MixinClass : ((abstract new (...args: any[]) => MixinClass) & { prototype: Mixin2.MixinClass; staticMixinMethod(): void; }) & TBase -> : ^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>MixinClass : ((abstract new (...args: any[]) => MixinClass) & { prototype: MixinClass; staticMixinMethod(): void; }) & TBase +> : ^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ } class DerivedFromAbstract2 extends Mixin2(AbstractBase) { @@ -50,8 +50,8 @@ class DerivedFromAbstract2 extends Mixin2(AbstractBase) { > : ^^^^^^^^^^^^^^^^^^^^ >Mixin2(AbstractBase) : Mixin2.MixinClass & AbstractBase > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->Mixin2 : any>(baseClass: TBase) => ((abstract new (...args: any[]) => MixinClass) & { prototype: Mixin2.MixinClass; staticMixinMethod(): void; }) & TBase -> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Mixin2 : any>(baseClass: TBase) => ((abstract new (...args: any[]) => MixinClass) & { prototype: MixinClass; staticMixinMethod(): void; }) & TBase +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >AbstractBase : typeof AbstractBase > : ^^^^^^^^^^^^^^^^^^^ diff --git a/tests/baselines/reference/mixinClassesAnnotated.types b/tests/baselines/reference/mixinClassesAnnotated.types index 51b584b79a06f..7f8b3580b7ca1 100644 --- a/tests/baselines/reference/mixinClassesAnnotated.types +++ b/tests/baselines/reference/mixinClassesAnnotated.types @@ -61,8 +61,8 @@ const Printable = >(superClass: T): Constructor : ^^^^^^ class extends superClass { ->class extends superClass { static message = "hello"; print() { const output = this.x + "," + this.y; } } : { new (...args: any[]): (Anonymous class); prototype: Printable.(Anonymous class); message: string; } & T -> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>class extends superClass { static message = "hello"; print() { const output = this.x + "," + this.y; } } : { new (...args: any[]): (Anonymous class); prototype: (Anonymous class); message: string; } & T +> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >superClass : Base > : ^^^^ @@ -149,8 +149,8 @@ function Tagged>(superClass: T): Constructor & } } return C; ->C : { new (...args: any[]): C; prototype: Tagged.C; } & T -> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>C : { new (...args: any[]): C; prototype: C; } & T +> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^ } const Thing1 = Tagged(Derived); diff --git a/tests/baselines/reference/mixinClassesAnonymous.types b/tests/baselines/reference/mixinClassesAnonymous.types index f33037af8777f..280bf1a028d6f 100644 --- a/tests/baselines/reference/mixinClassesAnonymous.types +++ b/tests/baselines/reference/mixinClassesAnonymous.types @@ -45,14 +45,14 @@ class Derived extends Base { } const Printable = >(superClass: T) => class extends superClass { ->Printable : >(superClass: T) => { new (...args: any[]): (Anonymous class); prototype: Printable.(Anonymous class); message: string; } & T -> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->>(superClass: T) => class extends superClass { static message = "hello"; print() { const output = this.x + "," + this.y; }} : >(superClass: T) => { new (...args: any[]): (Anonymous class); prototype: Printable.(Anonymous class); message: string; } & T -> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Printable : >(superClass: T) => { new (...args: any[]): (Anonymous class); prototype: (Anonymous class); message: string; } & T +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>>(superClass: T) => class extends superClass { static message = "hello"; print() { const output = this.x + "," + this.y; }} : >(superClass: T) => { new (...args: any[]): (Anonymous class); prototype: (Anonymous class); message: string; } & T +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >superClass : T > : ^ ->class extends superClass { static message = "hello"; print() { const output = this.x + "," + this.y; }} : { new (...args: any[]): (Anonymous class); prototype: Printable.(Anonymous class); message: string; } & T -> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>class extends superClass { static message = "hello"; print() { const output = this.x + "," + this.y; }} : { new (...args: any[]): (Anonymous class); prototype: (Anonymous class); message: string; } & T +> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >superClass : Base > : ^^^^ @@ -91,8 +91,8 @@ const Printable = >(superClass: T) => class extends } function Tagged>(superClass: T) { ->Tagged : >(superClass: T) => { new (...args: any[]): C; prototype: Tagged.C; } & T -> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Tagged : >(superClass: T) => { new (...args: any[]): C; prototype: C; } & T +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^ >superClass : T > : ^ @@ -133,39 +133,39 @@ function Tagged>(superClass: T) { } } return C; ->C : { new (...args: any[]): C; prototype: Tagged.C; } & T -> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>C : { new (...args: any[]): C; prototype: C; } & T +> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^ } const Thing1 = Tagged(Derived); ->Thing1 : { new (...args: any[]): Tagged.C; prototype: Tagged.C; } & typeof Derived -> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->Tagged(Derived) : { new (...args: any[]): Tagged.C; prototype: Tagged.C; } & typeof Derived -> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->Tagged : >(superClass: T) => { new (...args: any[]): C; prototype: Tagged.C; } & T -> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Thing1 : { new (...args: any[]): Tagged.C; prototype: Tagged.C; } & typeof Derived +> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Tagged(Derived) : { new (...args: any[]): Tagged.C; prototype: Tagged.C; } & typeof Derived +> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Tagged : >(superClass: T) => { new (...args: any[]): C; prototype: C; } & T +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^ >Derived : typeof Derived > : ^^^^^^^^^^^^^^ const Thing2 = Tagged(Printable(Derived)); ->Thing2 : { new (...args: any[]): Tagged<{ new (...args: any[]): Printable.(Anonymous class); prototype: Printable.(Anonymous class); message: string; } & typeof Derived>.C; prototype: Tagged.C; } & { new (...args: any[]): Printable.(Anonymous class); prototype: Printable.(Anonymous class); message: string; } & typeof Derived -> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->Tagged(Printable(Derived)) : { new (...args: any[]): Tagged<{ new (...args: any[]): Printable.(Anonymous class); prototype: Printable.(Anonymous class); message: string; } & typeof Derived>.C; prototype: Tagged.C; } & { new (...args: any[]): Printable.(Anonymous class); prototype: Printable.(Anonymous class); message: string; } & typeof Derived -> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->Tagged : >(superClass: T) => { new (...args: any[]): C; prototype: Tagged.C; } & T -> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->Printable(Derived) : { new (...args: any[]): Printable.(Anonymous class); prototype: Printable.(Anonymous class); message: string; } & typeof Derived -> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->Printable : >(superClass: T) => { new (...args: any[]): (Anonymous class); prototype: Printable.(Anonymous class); message: string; } & T -> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Thing2 : { new (...args: any[]): Tagged<{ new (...args: any[]): Printable.(Anonymous class); prototype: Printable.(Anonymous class); message: string; } & typeof Derived>.C; prototype: Tagged<{ new (...args: any[]): Printable.(Anonymous class); prototype: Printable.(Anonymous class); message: string; } & typeof Derived>.C; } & { new (...args: any[]): Printable.(Anonymous class); prototype: Printable.(Anonymous class); message: string; } & typeof Derived +> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Tagged(Printable(Derived)) : { new (...args: any[]): Tagged<{ new (...args: any[]): Printable.(Anonymous class); prototype: Printable.(Anonymous class); message: string; } & typeof Derived>.C; prototype: Tagged<{ new (...args: any[]): Printable.(Anonymous class); prototype: Printable.(Anonymous class); message: string; } & typeof Derived>.C; } & { new (...args: any[]): Printable.(Anonymous class); prototype: Printable.(Anonymous class); message: string; } & typeof Derived +> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Tagged : >(superClass: T) => { new (...args: any[]): C; prototype: C; } & T +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^ +>Printable(Derived) : { new (...args: any[]): Printable.(Anonymous class); prototype: Printable.(Anonymous class); message: string; } & typeof Derived +> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Printable : >(superClass: T) => { new (...args: any[]): (Anonymous class); prototype: (Anonymous class); message: string; } & T +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >Derived : typeof Derived > : ^^^^^^^^^^^^^^ Thing2.message; >Thing2.message : string > : ^^^^^^ ->Thing2 : { new (...args: any[]): Tagged<{ new (...args: any[]): Printable.(Anonymous class); prototype: Printable.(Anonymous class); message: string; } & typeof Derived>.C; prototype: Tagged.C; } & { new (...args: any[]): Printable.(Anonymous class); prototype: Printable.(Anonymous class); message: string; } & typeof Derived -> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Thing2 : { new (...args: any[]): Tagged<{ new (...args: any[]): Printable.(Anonymous class); prototype: Printable.(Anonymous class); message: string; } & typeof Derived>.C; prototype: Tagged<{ new (...args: any[]): Printable.(Anonymous class); prototype: Printable.(Anonymous class); message: string; } & typeof Derived>.C; } & { new (...args: any[]): Printable.(Anonymous class); prototype: Printable.(Anonymous class); message: string; } & typeof Derived +> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >message : string > : ^^^^^^ @@ -178,8 +178,8 @@ function f1() { > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >new Thing1(1, 2, 3) : Tagged.C & Derived > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->Thing1 : { new (...args: any[]): Tagged.C; prototype: Tagged.C; } & typeof Derived -> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Thing1 : { new (...args: any[]): Tagged.C; prototype: Tagged.C; } & typeof Derived +> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >1 : 1 > : ^ >2 : 2 @@ -209,12 +209,12 @@ function f2() { > : ^^^^^^^^^^ const thing = new Thing2(1, 2, 3); ->thing : Tagged<{ new (...args: any[]): Printable.(Anonymous class); prototype: Printable.(Anonymous class); message: string; } & typeof Derived>.C & Printable.(Anonymous class) & Derived -> : ^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->new Thing2(1, 2, 3) : Tagged<{ new (...args: any[]): Printable.(Anonymous class); prototype: Printable.(Anonymous class); message: string; } & typeof Derived>.C & Printable.(Anonymous class) & Derived -> : ^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->Thing2 : { new (...args: any[]): Tagged<{ new (...args: any[]): Printable.(Anonymous class); prototype: Printable.(Anonymous class); message: string; } & typeof Derived>.C; prototype: Tagged.C; } & { new (...args: any[]): Printable.(Anonymous class); prototype: Printable.(Anonymous class); message: string; } & typeof Derived -> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>thing : Tagged<{ new (...args: any[]): Printable.(Anonymous class); prototype: Printable.(Anonymous class); message: string; } & typeof Derived>.C & Printable.(Anonymous class) & Derived +> : ^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>new Thing2(1, 2, 3) : Tagged<{ new (...args: any[]): Printable.(Anonymous class); prototype: Printable.(Anonymous class); message: string; } & typeof Derived>.C & Printable.(Anonymous class) & Derived +> : ^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Thing2 : { new (...args: any[]): Tagged<{ new (...args: any[]): Printable.(Anonymous class); prototype: Printable.(Anonymous class); message: string; } & typeof Derived>.C; prototype: Tagged<{ new (...args: any[]): Printable.(Anonymous class); prototype: Printable.(Anonymous class); message: string; } & typeof Derived>.C; } & { new (...args: any[]): Printable.(Anonymous class); prototype: Printable.(Anonymous class); message: string; } & typeof Derived +> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >1 : 1 > : ^ >2 : 2 @@ -225,16 +225,16 @@ function f2() { thing.x; >thing.x : number > : ^^^^^^ ->thing : Tagged<{ new (...args: any[]): Printable.(Anonymous class); prototype: Printable.(Anonymous class); message: string; } & typeof Derived>.C & Printable.(Anonymous class) & Derived -> : ^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>thing : Tagged<{ new (...args: any[]): Printable.(Anonymous class); prototype: Printable.(Anonymous class); message: string; } & typeof Derived>.C & Printable.(Anonymous class) & Derived +> : ^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >x : number > : ^^^^^^ thing._tag; >thing._tag : string > : ^^^^^^ ->thing : Tagged<{ new (...args: any[]): Printable.(Anonymous class); prototype: Printable.(Anonymous class); message: string; } & typeof Derived>.C & Printable.(Anonymous class) & Derived -> : ^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>thing : Tagged<{ new (...args: any[]): Printable.(Anonymous class); prototype: Printable.(Anonymous class); message: string; } & typeof Derived>.C & Printable.(Anonymous class) & Derived +> : ^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >_tag : string > : ^^^^^^ @@ -243,8 +243,8 @@ function f2() { > : ^^^^ >thing.print : () => void > : ^^^^^^^^^^ ->thing : Tagged<{ new (...args: any[]): Printable.(Anonymous class); prototype: Printable.(Anonymous class); message: string; } & typeof Derived>.C & Printable.(Anonymous class) & Derived -> : ^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>thing : Tagged<{ new (...args: any[]): Printable.(Anonymous class); prototype: Printable.(Anonymous class); message: string; } & typeof Derived>.C & Printable.(Anonymous class) & Derived +> : ^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >print : () => void > : ^^^^^^^^^^ } @@ -252,8 +252,8 @@ function f2() { class Thing3 extends Thing2 { >Thing3 : Thing3 > : ^^^^^^ ->Thing2 : Tagged<{ new (...args: any[]): Printable.(Anonymous class); prototype: Printable.(Anonymous class); message: string; } & typeof Derived>.C & Printable.(Anonymous class) & Derived -> : ^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Thing2 : Tagged<{ new (...args: any[]): Printable.(Anonymous class); prototype: Printable.(Anonymous class); message: string; } & typeof Derived>.C & Printable.(Anonymous class) & Derived +> : ^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ constructor(tag: string) { >tag : string @@ -262,8 +262,8 @@ class Thing3 extends Thing2 { super(10, 20, 30); >super(10, 20, 30) : void > : ^^^^ ->super : { new (...args: any[]): Tagged<{ new (...args: any[]): Printable.(Anonymous class); prototype: Printable.(Anonymous class); message: string; } & typeof Derived>.C; prototype: Tagged.C; } & { new (...args: any[]): Printable.(Anonymous class); prototype: Printable.(Anonymous class); message: string; } & typeof Derived -> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>super : { new (...args: any[]): Tagged<{ new (...args: any[]): Printable.(Anonymous class); prototype: Printable.(Anonymous class); message: string; } & typeof Derived>.C; prototype: Tagged<{ new (...args: any[]): Printable.(Anonymous class); prototype: Printable.(Anonymous class); message: string; } & typeof Derived>.C; } & { new (...args: any[]): Printable.(Anonymous class); prototype: Printable.(Anonymous class); message: string; } & typeof Derived +> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >10 : 10 > : ^^ >20 : 20 @@ -302,16 +302,16 @@ class Thing3 extends Thing2 { // Repro from #13805 const Timestamped = >(Base: CT) => { ->Timestamped : >(Base: CT) => { new (...args: any[]): (Anonymous class); prototype: Timestamped.(Anonymous class); } & CT -> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->>(Base: CT) => { return class extends Base { timestamp = new Date(); };} : >(Base: CT) => { new (...args: any[]): (Anonymous class); prototype: Timestamped.(Anonymous class); } & CT -> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Timestamped : >(Base: CT) => { new (...args: any[]): (Anonymous class); prototype: (Anonymous class); } & CT +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>>(Base: CT) => { return class extends Base { timestamp = new Date(); };} : >(Base: CT) => { new (...args: any[]): (Anonymous class); prototype: (Anonymous class); } & CT +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >Base : CT > : ^^ return class extends Base { ->class extends Base { timestamp = new Date(); } : { new (...args: any[]): (Anonymous class); prototype: Timestamped.(Anonymous class); } & CT -> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>class extends Base { timestamp = new Date(); } : { new (...args: any[]): (Anonymous class); prototype: (Anonymous class); } & CT +> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >Base : object > : ^^^^^^ diff --git a/tests/baselines/reference/mixinIntersectionIsValidbaseType.types b/tests/baselines/reference/mixinIntersectionIsValidbaseType.types index 089dcc412e27e..ab6245c58019c 100644 --- a/tests/baselines/reference/mixinIntersectionIsValidbaseType.types +++ b/tests/baselines/reference/mixinIntersectionIsValidbaseType.types @@ -19,10 +19,10 @@ export interface Initable { * Plain mixin where the superclass must be Initable */ export const Serializable = & Initable>( ->Serializable : & Initable>(SuperClass: K) => { new (...args: any[]): SerializableLocal; prototype: Serializable.SerializableLocal; init(...args: any[]): void; } & K -> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^ -> & Initable>( SuperClass: K) => { const LocalMixin = (InnerSuperClass: K) => { return class SerializableLocal extends InnerSuperClass { } }; let ResultClass = LocalMixin(SuperClass); return ResultClass;} : & Initable>(SuperClass: K) => { new (...args: any[]): SerializableLocal; prototype: Serializable.SerializableLocal; init(...args: any[]): void; } & K -> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^ +>Serializable : & Initable>(SuperClass: K) => { new (...args: any[]): SerializableLocal; prototype: SerializableLocal; init(...args: any[]): void; } & K +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^ +> & Initable>( SuperClass: K) => { const LocalMixin = (InnerSuperClass: K) => { return class SerializableLocal extends InnerSuperClass { } }; let ResultClass = LocalMixin(SuperClass); return ResultClass;} : & Initable>(SuperClass: K) => { new (...args: any[]): SerializableLocal; prototype: SerializableLocal; init(...args: any[]): void; } & K +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^ SuperClass: K >SuperClass : K @@ -30,35 +30,35 @@ export const Serializable = & Initable>( ) => { const LocalMixin = (InnerSuperClass: K) => { ->LocalMixin : (InnerSuperClass: K) => { new (...args: any[]): SerializableLocal; prototype: Serializable.SerializableLocal; init(...args: any[]): void; } & K -> : ^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^ ->(InnerSuperClass: K) => { return class SerializableLocal extends InnerSuperClass { } } : (InnerSuperClass: K) => { new (...args: any[]): SerializableLocal; prototype: Serializable.SerializableLocal; init(...args: any[]): void; } & K -> : ^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^ +>LocalMixin : (InnerSuperClass: K) => { new (...args: any[]): SerializableLocal; prototype: SerializableLocal; init(...args: any[]): void; } & K +> : ^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^ +>(InnerSuperClass: K) => { return class SerializableLocal extends InnerSuperClass { } } : (InnerSuperClass: K) => { new (...args: any[]): SerializableLocal; prototype: SerializableLocal; init(...args: any[]): void; } & K +> : ^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^ >InnerSuperClass : K > : ^ return class SerializableLocal extends InnerSuperClass { ->class SerializableLocal extends InnerSuperClass { } : { new (...args: any[]): SerializableLocal; prototype: Serializable.SerializableLocal; init(...args: any[]): void; } & K -> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^ ->SerializableLocal : { new (...args: any[]): SerializableLocal; prototype: Serializable.SerializableLocal; init(...args: any[]): void; } & K -> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^ +>class SerializableLocal extends InnerSuperClass { } : { new (...args: any[]): SerializableLocal; prototype: SerializableLocal; init(...args: any[]): void; } & K +> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^ +>SerializableLocal : { new (...args: any[]): SerializableLocal; prototype: SerializableLocal; init(...args: any[]): void; } & K +> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^ >InnerSuperClass : Initable > : ^^^^^^^^ } }; let ResultClass = LocalMixin(SuperClass); ->ResultClass : { new (...args: any[]): SerializableLocal; prototype: Serializable.SerializableLocal; init(...args: any[]): void; } & K -> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^ ->LocalMixin(SuperClass) : { new (...args: any[]): SerializableLocal; prototype: Serializable.SerializableLocal; init(...args: any[]): void; } & K -> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^ ->LocalMixin : (InnerSuperClass: K) => { new (...args: any[]): SerializableLocal; prototype: Serializable.SerializableLocal; init(...args: any[]): void; } & K -> : ^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^ +>ResultClass : { new (...args: any[]): SerializableLocal; prototype: SerializableLocal; init(...args: any[]): void; } & K +> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^ +>LocalMixin(SuperClass) : { new (...args: any[]): SerializableLocal; prototype: SerializableLocal; init(...args: any[]): void; } & K +> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^ +>LocalMixin : (InnerSuperClass: K) => { new (...args: any[]): SerializableLocal; prototype: SerializableLocal; init(...args: any[]): void; } & K +> : ^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^ >SuperClass : K > : ^ return ResultClass; ->ResultClass : { new (...args: any[]): SerializableLocal; prototype: Serializable.SerializableLocal; init(...args: any[]): void; } & K -> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^ +>ResultClass : { new (...args: any[]): SerializableLocal; prototype: SerializableLocal; init(...args: any[]): void; } & K +> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^ }; @@ -71,28 +71,28 @@ const AMixin = & Initable>(SuperClass: K) => { > : ^ let SomeHowOkay = class A extends SuperClass { ->SomeHowOkay : { new (...args: any[]): A; prototype: AMixin.A; init(...args: any[]): void; } & K -> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^ ->class A extends SuperClass { } : { new (...args: any[]): A; prototype: AMixin.A; init(...args: any[]): void; } & K -> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^ ->A : { new (...args: any[]): A; prototype: AMixin.A; init(...args: any[]): void; } & K -> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^ +>SomeHowOkay : { new (...args: any[]): A; prototype: A; init(...args: any[]): void; } & K +> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^ +>class A extends SuperClass { } : { new (...args: any[]): A; prototype: A; init(...args: any[]): void; } & K +> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^ +>A : { new (...args: any[]): A; prototype: A; init(...args: any[]): void; } & K +> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^ >SuperClass : Initable > : ^^^^^^^^ }; let SomeHowNotOkay = class A extends Serializable(SuperClass) { ->SomeHowNotOkay : { new (...args: any[]): A; prototype: AMixin.A; init(...args: any[]): void; } & K -> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^ ->class A extends Serializable(SuperClass) { } : { new (...args: any[]): A; prototype: AMixin.A; init(...args: any[]): void; } & K -> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^ ->A : { new (...args: any[]): A; prototype: AMixin.A; init(...args: any[]): void; } & K -> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^ +>SomeHowNotOkay : { new (...args: any[]): A; prototype: A; init(...args: any[]): void; } & K +> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^ +>class A extends Serializable(SuperClass) { } : { new (...args: any[]): A; prototype: A; init(...args: any[]): void; } & K +> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^ +>A : { new (...args: any[]): A; prototype: A; init(...args: any[]): void; } & K +> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^ >Serializable(SuperClass) : Serializable.SerializableLocal & Initable > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->Serializable : & Initable>(SuperClass: K_1) => { new (...args: any[]): SerializableLocal; prototype: Serializable.SerializableLocal; init(...args: any[]): void; } & K_1 -> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^ +>Serializable : & Initable>(SuperClass: K_1) => { new (...args: any[]): SerializableLocal; prototype: SerializableLocal; init(...args: any[]): void; } & K_1 +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^ >SuperClass : K > : ^ diff --git a/tests/baselines/reference/mixinOverMappedTypeNoCrash.types b/tests/baselines/reference/mixinOverMappedTypeNoCrash.types index 72de275311d0f..0e1afc72f1706 100644 --- a/tests/baselines/reference/mixinOverMappedTypeNoCrash.types +++ b/tests/baselines/reference/mixinOverMappedTypeNoCrash.types @@ -52,6 +52,6 @@ function cloneClass>(OriginalClass: T): T { } } return AnotherOriginalClass ->AnotherOriginalClass : { new (...args: any[]): AnotherOriginalClass; prototype: cloneClass.AnotherOriginalClass; } & T -> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>AnotherOriginalClass : { new (...args: any[]): AnotherOriginalClass; prototype: AnotherOriginalClass; } & T +> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ } diff --git a/tests/baselines/reference/mixinPrivateAndProtected.errors.txt b/tests/baselines/reference/mixinPrivateAndProtected.errors.txt index 172f988696d72..4641bcb479090 100644 --- a/tests/baselines/reference/mixinPrivateAndProtected.errors.txt +++ b/tests/baselines/reference/mixinPrivateAndProtected.errors.txt @@ -7,17 +7,17 @@ mixinPrivateAndProtected.ts(50,4): error TS2339: Property 'ptd' does not exist o mixinPrivateAndProtected.ts(51,4): error TS2339: Property 'pvt' does not exist on type 'never'. The intersection 'mixB.(Anonymous class) & A' was reduced to 'never' because property 'pvt' exists in multiple constituents and is private in some. mixinPrivateAndProtected.ts(53,5): error TS2339: Property 'pb' does not exist on type 'never'. - The intersection 'mixC<{ new (...args: any[]): mixB.(Anonymous class); prototype: mixB.(Anonymous class); } & typeof A>.(Anonymous class) & mixB.(Anonymous class) & A' was reduced to 'never' because property 'pvt' exists in multiple constituents and is private in some. + The intersection 'mixC<{ new (...args: any[]): mixB.(Anonymous class); prototype: mixB.(Anonymous class); } & typeof A>.(Anonymous class) & mixB.(Anonymous class) & A' was reduced to 'never' because property 'pvt' exists in multiple constituents and is private in some. mixinPrivateAndProtected.ts(54,5): error TS2339: Property 'ptd' does not exist on type 'never'. - The intersection 'mixC<{ new (...args: any[]): mixB.(Anonymous class); prototype: mixB.(Anonymous class); } & typeof A>.(Anonymous class) & mixB.(Anonymous class) & A' was reduced to 'never' because property 'pvt' exists in multiple constituents and is private in some. + The intersection 'mixC<{ new (...args: any[]): mixB.(Anonymous class); prototype: mixB.(Anonymous class); } & typeof A>.(Anonymous class) & mixB.(Anonymous class) & A' was reduced to 'never' because property 'pvt' exists in multiple constituents and is private in some. mixinPrivateAndProtected.ts(55,5): error TS2339: Property 'pvt' does not exist on type 'never'. - The intersection 'mixC<{ new (...args: any[]): mixB.(Anonymous class); prototype: mixB.(Anonymous class); } & typeof A>.(Anonymous class) & mixB.(Anonymous class) & A' was reduced to 'never' because property 'pvt' exists in multiple constituents and is private in some. + The intersection 'mixC<{ new (...args: any[]): mixB.(Anonymous class); prototype: mixB.(Anonymous class); } & typeof A>.(Anonymous class) & mixB.(Anonymous class) & A' was reduced to 'never' because property 'pvt' exists in multiple constituents and is private in some. mixinPrivateAndProtected.ts(57,6): error TS2339: Property 'pb' does not exist on type 'never'. - The intersection 'mixC<{ new (...args: any[]): mixB2.(Anonymous class); prototype: mixB2.(Anonymous class); } & typeof A>.(Anonymous class) & mixB2.(Anonymous class) & A' was reduced to 'never' because property 'pvt' exists in multiple constituents and is private in some. + The intersection 'mixC<{ new (...args: any[]): mixB2.(Anonymous class); prototype: mixB2.(Anonymous class); } & typeof A>.(Anonymous class) & mixB2.(Anonymous class) & A' was reduced to 'never' because property 'pvt' exists in multiple constituents and is private in some. mixinPrivateAndProtected.ts(58,6): error TS2339: Property 'ptd' does not exist on type 'never'. - The intersection 'mixC<{ new (...args: any[]): mixB2.(Anonymous class); prototype: mixB2.(Anonymous class); } & typeof A>.(Anonymous class) & mixB2.(Anonymous class) & A' was reduced to 'never' because property 'pvt' exists in multiple constituents and is private in some. + The intersection 'mixC<{ new (...args: any[]): mixB2.(Anonymous class); prototype: mixB2.(Anonymous class); } & typeof A>.(Anonymous class) & mixB2.(Anonymous class) & A' was reduced to 'never' because property 'pvt' exists in multiple constituents and is private in some. mixinPrivateAndProtected.ts(59,6): error TS2339: Property 'pvt' does not exist on type 'never'. - The intersection 'mixC<{ new (...args: any[]): mixB2.(Anonymous class); prototype: mixB2.(Anonymous class); } & typeof A>.(Anonymous class) & mixB2.(Anonymous class) & A' was reduced to 'never' because property 'pvt' exists in multiple constituents and is private in some. + The intersection 'mixC<{ new (...args: any[]): mixB2.(Anonymous class); prototype: mixB2.(Anonymous class); } & typeof A>.(Anonymous class) & mixB2.(Anonymous class) & A' was reduced to 'never' because property 'pvt' exists in multiple constituents and is private in some. ==== mixinPrivateAndProtected.ts (11 errors) ==== @@ -89,28 +89,28 @@ mixinPrivateAndProtected.ts(59,6): error TS2339: Property 'pvt' does not exist o abc.pb.toFixed(); ~~ !!! error TS2339: Property 'pb' does not exist on type 'never'. -!!! error TS2339: The intersection 'mixC<{ new (...args: any[]): mixB.(Anonymous class); prototype: mixB.(Anonymous class); } & typeof A>.(Anonymous class) & mixB.(Anonymous class) & A' was reduced to 'never' because property 'pvt' exists in multiple constituents and is private in some. +!!! error TS2339: The intersection 'mixC<{ new (...args: any[]): mixB.(Anonymous class); prototype: mixB.(Anonymous class); } & typeof A>.(Anonymous class) & mixB.(Anonymous class) & A' was reduced to 'never' because property 'pvt' exists in multiple constituents and is private in some. abc.ptd.toFixed(); // Error ~~~ !!! error TS2339: Property 'ptd' does not exist on type 'never'. -!!! error TS2339: The intersection 'mixC<{ new (...args: any[]): mixB.(Anonymous class); prototype: mixB.(Anonymous class); } & typeof A>.(Anonymous class) & mixB.(Anonymous class) & A' was reduced to 'never' because property 'pvt' exists in multiple constituents and is private in some. +!!! error TS2339: The intersection 'mixC<{ new (...args: any[]): mixB.(Anonymous class); prototype: mixB.(Anonymous class); } & typeof A>.(Anonymous class) & mixB.(Anonymous class) & A' was reduced to 'never' because property 'pvt' exists in multiple constituents and is private in some. abc.pvt.toFixed(); // Error ~~~ !!! error TS2339: Property 'pvt' does not exist on type 'never'. -!!! error TS2339: The intersection 'mixC<{ new (...args: any[]): mixB.(Anonymous class); prototype: mixB.(Anonymous class); } & typeof A>.(Anonymous class) & mixB.(Anonymous class) & A' was reduced to 'never' because property 'pvt' exists in multiple constituents and is private in some. +!!! error TS2339: The intersection 'mixC<{ new (...args: any[]): mixB.(Anonymous class); prototype: mixB.(Anonymous class); } & typeof A>.(Anonymous class) & mixB.(Anonymous class) & A' was reduced to 'never' because property 'pvt' exists in multiple constituents and is private in some. ab2c.pb.toFixed(); ~~ !!! error TS2339: Property 'pb' does not exist on type 'never'. -!!! error TS2339: The intersection 'mixC<{ new (...args: any[]): mixB2.(Anonymous class); prototype: mixB2.(Anonymous class); } & typeof A>.(Anonymous class) & mixB2.(Anonymous class) & A' was reduced to 'never' because property 'pvt' exists in multiple constituents and is private in some. +!!! error TS2339: The intersection 'mixC<{ new (...args: any[]): mixB2.(Anonymous class); prototype: mixB2.(Anonymous class); } & typeof A>.(Anonymous class) & mixB2.(Anonymous class) & A' was reduced to 'never' because property 'pvt' exists in multiple constituents and is private in some. ab2c.ptd.toFixed(); // Error ~~~ !!! error TS2339: Property 'ptd' does not exist on type 'never'. -!!! error TS2339: The intersection 'mixC<{ new (...args: any[]): mixB2.(Anonymous class); prototype: mixB2.(Anonymous class); } & typeof A>.(Anonymous class) & mixB2.(Anonymous class) & A' was reduced to 'never' because property 'pvt' exists in multiple constituents and is private in some. +!!! error TS2339: The intersection 'mixC<{ new (...args: any[]): mixB2.(Anonymous class); prototype: mixB2.(Anonymous class); } & typeof A>.(Anonymous class) & mixB2.(Anonymous class) & A' was reduced to 'never' because property 'pvt' exists in multiple constituents and is private in some. ab2c.pvt.toFixed(); // Error ~~~ !!! error TS2339: Property 'pvt' does not exist on type 'never'. -!!! error TS2339: The intersection 'mixC<{ new (...args: any[]): mixB2.(Anonymous class); prototype: mixB2.(Anonymous class); } & typeof A>.(Anonymous class) & mixB2.(Anonymous class) & A' was reduced to 'never' because property 'pvt' exists in multiple constituents and is private in some. +!!! error TS2339: The intersection 'mixC<{ new (...args: any[]): mixB2.(Anonymous class); prototype: mixB2.(Anonymous class); } & typeof A>.(Anonymous class) & mixB2.(Anonymous class) & A' was reduced to 'never' because property 'pvt' exists in multiple constituents and is private in some. // Repro from #13924 diff --git a/tests/baselines/reference/mixinPrivateAndProtected.types b/tests/baselines/reference/mixinPrivateAndProtected.types index 00ea84d40a6ad..4a3275df993cd 100644 --- a/tests/baselines/reference/mixinPrivateAndProtected.types +++ b/tests/baselines/reference/mixinPrivateAndProtected.types @@ -33,14 +33,14 @@ class A { } function mixB>(Cls: T) { ->mixB : >(Cls: T) => { new (...args: any[]): (Anonymous class); prototype: mixB.(Anonymous class); } & T -> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>mixB : >(Cls: T) => { new (...args: any[]): (Anonymous class); prototype: (Anonymous class); } & T +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >Cls : T > : ^ return class extends Cls { ->class extends Cls { protected ptd: number = 10; private pvt: number = 0; } : { new (...args: any[]): (Anonymous class); prototype: mixB.(Anonymous class); } & T -> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>class extends Cls { protected ptd: number = 10; private pvt: number = 0; } : { new (...args: any[]): (Anonymous class); prototype: (Anonymous class); } & T +> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >Cls : {} > : ^^ @@ -60,14 +60,14 @@ function mixB>(Cls: T) { } function mixB2>(Cls: T) { ->mixB2 : >(Cls: T) => { new (...args: any[]): (Anonymous class); prototype: mixB2.(Anonymous class); } & T -> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>mixB2 : >(Cls: T) => { new (...args: any[]): (Anonymous class); prototype: (Anonymous class); } & T +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >Cls : T > : ^ return class extends Cls { ->class extends Cls { protected ptd: number = 10; } : { new (...args: any[]): (Anonymous class); prototype: mixB2.(Anonymous class); } & T -> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>class extends Cls { protected ptd: number = 10; } : { new (...args: any[]): (Anonymous class); prototype: (Anonymous class); } & T +> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >Cls : A > : ^ @@ -82,34 +82,34 @@ function mixB2>(Cls: T) { const AB = mixB(A), ->AB : { new (...args: any[]): mixB.(Anonymous class); prototype: mixB.(Anonymous class); } & typeof A -> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->mixB(A) : { new (...args: any[]): mixB.(Anonymous class); prototype: mixB.(Anonymous class); } & typeof A -> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->mixB : >(Cls: T) => { new (...args: any[]): (Anonymous class); prototype: mixB.(Anonymous class); } & T -> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>AB : { new (...args: any[]): mixB.(Anonymous class); prototype: mixB.(Anonymous class); } & typeof A +> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>mixB(A) : { new (...args: any[]): mixB.(Anonymous class); prototype: mixB.(Anonymous class); } & typeof A +> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>mixB : >(Cls: T) => { new (...args: any[]): (Anonymous class); prototype: (Anonymous class); } & T +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >A : typeof A > : ^^^^^^^^ AB2 = mixB2(A); ->AB2 : { new (...args: any[]): mixB2.(Anonymous class); prototype: mixB2.(Anonymous class); } & typeof A -> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->mixB2(A) : { new (...args: any[]): mixB2.(Anonymous class); prototype: mixB2.(Anonymous class); } & typeof A -> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->mixB2 : >(Cls: T) => { new (...args: any[]): (Anonymous class); prototype: mixB2.(Anonymous class); } & T -> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>AB2 : { new (...args: any[]): mixB2.(Anonymous class); prototype: mixB2.(Anonymous class); } & typeof A +> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>mixB2(A) : { new (...args: any[]): mixB2.(Anonymous class); prototype: mixB2.(Anonymous class); } & typeof A +> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>mixB2 : >(Cls: T) => { new (...args: any[]): (Anonymous class); prototype: (Anonymous class); } & T +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >A : typeof A > : ^^^^^^^^ function mixC>(Cls: T) { ->mixC : >(Cls: T) => { new (...args: any[]): (Anonymous class); prototype: mixC.(Anonymous class); } & T -> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>mixC : >(Cls: T) => { new (...args: any[]): (Anonymous class); prototype: (Anonymous class); } & T +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >Cls : T > : ^ return class extends Cls { ->class extends Cls { protected ptd: number = 100; private pvt: number = 0; } : { new (...args: any[]): (Anonymous class); prototype: mixC.(Anonymous class); } & T -> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>class extends Cls { protected ptd: number = 100; private pvt: number = 0; } : { new (...args: any[]): (Anonymous class); prototype: (Anonymous class); } & T +> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >Cls : {} > : ^^ @@ -130,24 +130,24 @@ function mixC>(Cls: T) { const AB2C = mixC(AB2), ->AB2C : { new (...args: any[]): mixC<{ new (...args: any[]): mixB2.(Anonymous class); prototype: mixB2.(Anonymous class); } & typeof A>.(Anonymous class); prototype: mixC.(Anonymous class); } & { new (...args: any[]): mixB2.(Anonymous class); prototype: mixB2.(Anonymous class); } & typeof A -> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->mixC(AB2) : { new (...args: any[]): mixC<{ new (...args: any[]): mixB2.(Anonymous class); prototype: mixB2.(Anonymous class); } & typeof A>.(Anonymous class); prototype: mixC.(Anonymous class); } & { new (...args: any[]): mixB2.(Anonymous class); prototype: mixB2.(Anonymous class); } & typeof A -> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->mixC : >(Cls: T) => { new (...args: any[]): (Anonymous class); prototype: mixC.(Anonymous class); } & T -> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->AB2 : { new (...args: any[]): mixB2.(Anonymous class); prototype: mixB2.(Anonymous class); } & typeof A -> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>AB2C : { new (...args: any[]): mixC<{ new (...args: any[]): mixB2.(Anonymous class); prototype: mixB2.(Anonymous class); } & typeof A>.(Anonymous class); prototype: mixC<{ new (...args: any[]): mixB2.(Anonymous class); prototype: mixB2.(Anonymous class); } & typeof A>.(Anonymous class); } & { new (...args: any[]): mixB2.(Anonymous class); prototype: mixB2.(Anonymous class); } & typeof A +> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>mixC(AB2) : { new (...args: any[]): mixC<{ new (...args: any[]): mixB2.(Anonymous class); prototype: mixB2.(Anonymous class); } & typeof A>.(Anonymous class); prototype: mixC<{ new (...args: any[]): mixB2.(Anonymous class); prototype: mixB2.(Anonymous class); } & typeof A>.(Anonymous class); } & { new (...args: any[]): mixB2.(Anonymous class); prototype: mixB2.(Anonymous class); } & typeof A +> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>mixC : >(Cls: T) => { new (...args: any[]): (Anonymous class); prototype: (Anonymous class); } & T +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>AB2 : { new (...args: any[]): mixB2.(Anonymous class); prototype: mixB2.(Anonymous class); } & typeof A +> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ABC = mixC(AB); ->ABC : { new (...args: any[]): mixC<{ new (...args: any[]): mixB.(Anonymous class); prototype: mixB.(Anonymous class); } & typeof A>.(Anonymous class); prototype: mixC.(Anonymous class); } & { new (...args: any[]): mixB.(Anonymous class); prototype: mixB.(Anonymous class); } & typeof A -> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->mixC(AB) : { new (...args: any[]): mixC<{ new (...args: any[]): mixB.(Anonymous class); prototype: mixB.(Anonymous class); } & typeof A>.(Anonymous class); prototype: mixC.(Anonymous class); } & { new (...args: any[]): mixB.(Anonymous class); prototype: mixB.(Anonymous class); } & typeof A -> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->mixC : >(Cls: T) => { new (...args: any[]): (Anonymous class); prototype: mixC.(Anonymous class); } & T -> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->AB : { new (...args: any[]): mixB.(Anonymous class); prototype: mixB.(Anonymous class); } & typeof A -> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>ABC : { new (...args: any[]): mixC<{ new (...args: any[]): mixB.(Anonymous class); prototype: mixB.(Anonymous class); } & typeof A>.(Anonymous class); prototype: mixC<{ new (...args: any[]): mixB.(Anonymous class); prototype: mixB.(Anonymous class); } & typeof A>.(Anonymous class); } & { new (...args: any[]): mixB.(Anonymous class); prototype: mixB.(Anonymous class); } & typeof A +> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>mixC(AB) : { new (...args: any[]): mixC<{ new (...args: any[]): mixB.(Anonymous class); prototype: mixB.(Anonymous class); } & typeof A>.(Anonymous class); prototype: mixC<{ new (...args: any[]): mixB.(Anonymous class); prototype: mixB.(Anonymous class); } & typeof A>.(Anonymous class); } & { new (...args: any[]): mixB.(Anonymous class); prototype: mixB.(Anonymous class); } & typeof A +> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>mixC : >(Cls: T) => { new (...args: any[]): (Anonymous class); prototype: (Anonymous class); } & T +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>AB : { new (...args: any[]): mixB.(Anonymous class); prototype: mixB.(Anonymous class); } & typeof A +> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ const a = new A(), @@ -163,24 +163,24 @@ const > : ^^^^^ >new AB() : never > : ^^^^^ ->AB : { new (...args: any[]): mixB.(Anonymous class); prototype: mixB.(Anonymous class); } & typeof A -> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>AB : { new (...args: any[]): mixB.(Anonymous class); prototype: mixB.(Anonymous class); } & typeof A +> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ abc = new ABC(), >abc : never > : ^^^^^ >new ABC() : never > : ^^^^^ ->ABC : { new (...args: any[]): mixC<{ new (...args: any[]): mixB.(Anonymous class); prototype: mixB.(Anonymous class); } & typeof A>.(Anonymous class); prototype: mixC.(Anonymous class); } & { new (...args: any[]): mixB.(Anonymous class); prototype: mixB.(Anonymous class); } & typeof A -> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>ABC : { new (...args: any[]): mixC<{ new (...args: any[]): mixB.(Anonymous class); prototype: mixB.(Anonymous class); } & typeof A>.(Anonymous class); prototype: mixC<{ new (...args: any[]): mixB.(Anonymous class); prototype: mixB.(Anonymous class); } & typeof A>.(Anonymous class); } & { new (...args: any[]): mixB.(Anonymous class); prototype: mixB.(Anonymous class); } & typeof A +> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ab2c = new AB2C(); >ab2c : never > : ^^^^^ >new AB2C() : never > : ^^^^^ ->AB2C : { new (...args: any[]): mixC<{ new (...args: any[]): mixB2.(Anonymous class); prototype: mixB2.(Anonymous class); } & typeof A>.(Anonymous class); prototype: mixC.(Anonymous class); } & { new (...args: any[]): mixB2.(Anonymous class); prototype: mixB2.(Anonymous class); } & typeof A -> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>AB2C : { new (...args: any[]): mixC<{ new (...args: any[]): mixB2.(Anonymous class); prototype: mixB2.(Anonymous class); } & typeof A>.(Anonymous class); prototype: mixC<{ new (...args: any[]): mixB2.(Anonymous class); prototype: mixB2.(Anonymous class); } & typeof A>.(Anonymous class); } & { new (...args: any[]): mixB2.(Anonymous class); prototype: mixB2.(Anonymous class); } & typeof A +> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ a.pb.toFixed(); >a.pb.toFixed() : string @@ -369,14 +369,14 @@ class Person { } function PersonMixin>(Base: T) { ->PersonMixin : >(Base: T) => { new (...args: any[]): (Anonymous class); prototype: PersonMixin.(Anonymous class); } & T -> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>PersonMixin : >(Base: T) => { new (...args: any[]): (Anonymous class); prototype: (Anonymous class); } & T +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >Base : T > : ^ return class extends Base { ->class extends Base { constructor(...args: any[]) { super(...args); } myProtectedFunction() { super.myProtectedFunction(); // do more things } } : { new (...args: any[]): (Anonymous class); prototype: PersonMixin.(Anonymous class); } & T -> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>class extends Base { constructor(...args: any[]) { super(...args); } myProtectedFunction() { super.myProtectedFunction(); // do more things } } : { new (...args: any[]): (Anonymous class); prototype: (Anonymous class); } & T +> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >Base : Person > : ^^^^^^ @@ -419,8 +419,8 @@ class Customer extends PersonMixin(Person) { > : ^^^^^^^^ >PersonMixin(Person) : PersonMixin.(Anonymous class) & Person > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->PersonMixin : >(Base: T) => { new (...args: any[]): (Anonymous class); prototype: PersonMixin.(Anonymous class); } & T -> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>PersonMixin : >(Base: T) => { new (...args: any[]): (Anonymous class); prototype: (Anonymous class); } & T +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >Person : typeof Person > : ^^^^^^^^^^^^^ diff --git a/tests/baselines/reference/mixingApparentTypeOverrides.types b/tests/baselines/reference/mixingApparentTypeOverrides.types index 6c1cad74f7820..f2c642a2f17dc 100644 --- a/tests/baselines/reference/mixingApparentTypeOverrides.types +++ b/tests/baselines/reference/mixingApparentTypeOverrides.types @@ -8,14 +8,14 @@ type Constructor = new(...args: any[]) => T; > : ^^^^^ function Tagged>(Base: T) { ->Tagged : >(Base: T) => { new (...args: any[]): (Anonymous class); prototype: Tagged.(Anonymous class); } & T -> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Tagged : >(Base: T) => { new (...args: any[]): (Anonymous class); prototype: (Anonymous class); } & T +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >Base : T > : ^ return class extends Base { ->class extends Base { _tag: string; constructor(...args: any[]) { super(...args); this._tag = ""; } } : { new (...args: any[]): (Anonymous class); prototype: Tagged.(Anonymous class); } & T -> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>class extends Base { _tag: string; constructor(...args: any[]) { super(...args); this._tag = ""; } } : { new (...args: any[]): (Anonymous class); prototype: (Anonymous class); } & T +> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >Base : {} > : ^^ @@ -70,8 +70,8 @@ class B extends Tagged(A) { > : ^ >Tagged(A) : Tagged.(Anonymous class) & A > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->Tagged : >(Base: T) => { new (...args: any[]): (Anonymous class); prototype: Tagged.(Anonymous class); } & T -> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Tagged : >(Base: T) => { new (...args: any[]): (Anonymous class); prototype: (Anonymous class); } & T +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >A : typeof A > : ^^^^^^^^ diff --git a/tests/baselines/reference/narrowTypeByInstanceofAnonymousConstructor1.symbols b/tests/baselines/reference/narrowTypeByInstanceofAnonymousConstructor1.symbols new file mode 100644 index 0000000000000..38ca2acce2b7d --- /dev/null +++ b/tests/baselines/reference/narrowTypeByInstanceofAnonymousConstructor1.symbols @@ -0,0 +1,36 @@ +//// [tests/cases/compiler/narrowTypeByInstanceofAnonymousConstructor1.ts] //// + +=== narrowTypeByInstanceofAnonymousConstructor1.ts === +// https://github.com/microsoft/TypeScript/issues/57317 + +function MakeClass(someStuff: T) { +>MakeClass : Symbol(MakeClass, Decl(narrowTypeByInstanceofAnonymousConstructor1.ts, 0, 0)) +>T : Symbol(T, Decl(narrowTypeByInstanceofAnonymousConstructor1.ts, 2, 19)) +>someStuff : Symbol(someStuff, Decl(narrowTypeByInstanceofAnonymousConstructor1.ts, 2, 22)) +>T : Symbol(T, Decl(narrowTypeByInstanceofAnonymousConstructor1.ts, 2, 19)) + + return class { + someStuff = someStuff; +>someStuff : Symbol((Anonymous class).someStuff, Decl(narrowTypeByInstanceofAnonymousConstructor1.ts, 3, 16)) +>someStuff : Symbol(someStuff, Decl(narrowTypeByInstanceofAnonymousConstructor1.ts, 2, 22)) + + }; +} + +const MadeClassNumber = MakeClass(123); +>MadeClassNumber : Symbol(MadeClassNumber, Decl(narrowTypeByInstanceofAnonymousConstructor1.ts, 8, 5)) +>MakeClass : Symbol(MakeClass, Decl(narrowTypeByInstanceofAnonymousConstructor1.ts, 0, 0)) + +declare const someInstance: unknown; +>someInstance : Symbol(someInstance, Decl(narrowTypeByInstanceofAnonymousConstructor1.ts, 10, 13)) + +if (someInstance instanceof MadeClassNumber) { +>someInstance : Symbol(someInstance, Decl(narrowTypeByInstanceofAnonymousConstructor1.ts, 10, 13)) +>MadeClassNumber : Symbol(MadeClassNumber, Decl(narrowTypeByInstanceofAnonymousConstructor1.ts, 8, 5)) + + someInstance.someStuff; +>someInstance.someStuff : Symbol((Anonymous class).someStuff, Decl(narrowTypeByInstanceofAnonymousConstructor1.ts, 3, 16)) +>someInstance : Symbol(someInstance, Decl(narrowTypeByInstanceofAnonymousConstructor1.ts, 10, 13)) +>someStuff : Symbol((Anonymous class).someStuff, Decl(narrowTypeByInstanceofAnonymousConstructor1.ts, 3, 16)) +} + diff --git a/tests/baselines/reference/narrowTypeByInstanceofAnonymousConstructor1.types b/tests/baselines/reference/narrowTypeByInstanceofAnonymousConstructor1.types new file mode 100644 index 0000000000000..681774c8e45f1 --- /dev/null +++ b/tests/baselines/reference/narrowTypeByInstanceofAnonymousConstructor1.types @@ -0,0 +1,55 @@ +//// [tests/cases/compiler/narrowTypeByInstanceofAnonymousConstructor1.ts] //// + +=== narrowTypeByInstanceofAnonymousConstructor1.ts === +// https://github.com/microsoft/TypeScript/issues/57317 + +function MakeClass(someStuff: T) { +>MakeClass : (someStuff: T) => typeof (Anonymous class) +> : ^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>someStuff : T +> : ^ + + return class { +>class { someStuff = someStuff; } : typeof (Anonymous class) +> : ^^^^^^^^^^^^^^^^^^^^^^^^ + + someStuff = someStuff; +>someStuff : T +> : ^ +>someStuff : T +> : ^ + + }; +} + +const MadeClassNumber = MakeClass(123); +>MadeClassNumber : typeof (Anonymous class) +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>MakeClass(123) : typeof (Anonymous class) +> : ^^^^^^^^^^^^^^^^^^^^^^^^ +>MakeClass : (someStuff: T) => typeof (Anonymous class) +> : ^ ^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>123 : 123 +> : ^^^ + +declare const someInstance: unknown; +>someInstance : unknown +> : ^^^^^^^ + +if (someInstance instanceof MadeClassNumber) { +>someInstance instanceof MadeClassNumber : boolean +> : ^^^^^^^ +>someInstance : unknown +> : ^^^^^^^ +>MadeClassNumber : typeof (Anonymous class) +> : ^^^^^^^^^^^^^^^^^^^^^^^^ + + someInstance.someStuff; +>someInstance.someStuff : number +> : ^^^^^^ +>someInstance : MakeClass.(Anonymous class) +> : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>someStuff : number +> : ^^^^^^ +} + diff --git a/tests/baselines/reference/noCrashOnMixin.types b/tests/baselines/reference/noCrashOnMixin.types index fd17fb05b8d6a..91a6bdf7a81ae 100644 --- a/tests/baselines/reference/noCrashOnMixin.types +++ b/tests/baselines/reference/noCrashOnMixin.types @@ -23,14 +23,14 @@ type Constructor = new (...args: any[]) => T; > : ^^^^^ function Mixin(Base: TBase) { ->Mixin : >(Base: TBase) => { new (...args: any[]): (Anonymous class); prototype: Mixin.(Anonymous class); } & TBase -> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Mixin : >(Base: TBase) => { new (...args: any[]): (Anonymous class); prototype: (Anonymous class); } & TBase +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >Base : TBase > : ^^^^^ return class extends Base { ->class extends Base { } : { new (...args: any[]): (Anonymous class); prototype: Mixin.(Anonymous class); } & TBase -> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>class extends Base { } : { new (...args: any[]): (Anonymous class); prototype: (Anonymous class); } & TBase +> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >Base : {} > : ^^ @@ -47,8 +47,8 @@ class CrashTrigger extends Mixin(Empty) { > : ^^^^^^^^^^^^ >Mixin(Empty) : Mixin.(Anonymous class) & Empty > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->Mixin : >(Base: TBase) => { new (...args: any[]): (Anonymous class); prototype: Mixin.(Anonymous class); } & TBase -> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Mixin : >(Base: TBase) => { new (...args: any[]): (Anonymous class); prototype: (Anonymous class); } & TBase +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >Empty : typeof Empty > : ^^^^^^^^^^^^ diff --git a/tests/baselines/reference/overrideBaseIntersectionMethod.types b/tests/baselines/reference/overrideBaseIntersectionMethod.types index 7c69c43f76efc..065b2f13b36b5 100644 --- a/tests/baselines/reference/overrideBaseIntersectionMethod.types +++ b/tests/baselines/reference/overrideBaseIntersectionMethod.types @@ -10,14 +10,14 @@ type Constructor = new (...args: any[]) => T; > : ^^^^^ const WithLocation = >(Base: T) => class extends Base { ->WithLocation : >(Base: T) => { new (...args: any[]): (Anonymous class); prototype: WithLocation.(Anonymous class); } & T -> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->>(Base: T) => class extends Base { getLocation(): [number, number] { const [x,y] = super.getLocation(); return [this.x | x, this.y | y]; }} : >(Base: T) => { new (...args: any[]): (Anonymous class); prototype: WithLocation.(Anonymous class); } & T -> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>WithLocation : >(Base: T) => { new (...args: any[]): (Anonymous class); prototype: (Anonymous class); } & T +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>>(Base: T) => class extends Base { getLocation(): [number, number] { const [x,y] = super.getLocation(); return [this.x | x, this.y | y]; }} : >(Base: T) => { new (...args: any[]): (Anonymous class); prototype: (Anonymous class); } & T +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >Base : T > : ^ ->class extends Base { getLocation(): [number, number] { const [x,y] = super.getLocation(); return [this.x | x, this.y | y]; }} : { new (...args: any[]): (Anonymous class); prototype: WithLocation.(Anonymous class); } & T -> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>class extends Base { getLocation(): [number, number] { const [x,y] = super.getLocation(); return [this.x | x, this.y | y]; }} : { new (...args: any[]): (Anonymous class); prototype: (Anonymous class); } & T +> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >Base : Point > : ^^^^^ @@ -94,8 +94,8 @@ class Foo extends WithLocation(Point) { > : ^^^ >WithLocation(Point) : WithLocation.(Anonymous class) & Point > : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ->WithLocation : >(Base: T) => { new (...args: any[]): (Anonymous class); prototype: WithLocation.(Anonymous class); } & T -> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>WithLocation : >(Base: T) => { new (...args: any[]): (Anonymous class); prototype: (Anonymous class); } & T +> : ^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >Point : typeof Point > : ^^^^^^^^^^^^ diff --git a/tests/baselines/reference/typeAliasFunctionTypeSharedSymbol.types b/tests/baselines/reference/typeAliasFunctionTypeSharedSymbol.types index aeee167e369c6..638f74cf25f57 100644 --- a/tests/baselines/reference/typeAliasFunctionTypeSharedSymbol.types +++ b/tests/baselines/reference/typeAliasFunctionTypeSharedSymbol.types @@ -4,16 +4,16 @@ // Repro from comment in #21496 function Mixin(Base: TBase) { ->Mixin : {}>(Base: TBase) => { new (...args: any[]): (Anonymous class); prototype: Mixin.(Anonymous class); } & TBase -> : ^ ^^^^^^^^^^^^^^^^^ ^^ ^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Mixin : {}>(Base: TBase) => { new (...args: any[]): (Anonymous class); prototype: (Anonymous class); } & TBase +> : ^ ^^^^^^^^^^^^^^^^^ ^^ ^^^^^ ^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >args : any[] > : ^^^^^ >Base : TBase > : ^^^^^ return class extends Base { ->class extends Base { } : { new (...args: any[]): (Anonymous class); prototype: Mixin.(Anonymous class); } & TBase -> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>class extends Base { } : { new (...args: any[]): (Anonymous class); prototype: (Anonymous class); } & TBase +> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >Base : {} > : ^^ @@ -21,10 +21,10 @@ function Mixin(Base: TBase) { } type Mixin = ReturnTypeOf ->Mixin : { new (...args: any[]): Mixin {}>.(Anonymous class); prototype: Mixin.(Anonymous class); } & (new (...args: any[]) => {}) -> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^ ->Mixin : {}>(Base: TBase) => { new (...args: any[]): (Anonymous class); prototype: Mixin.(Anonymous class); } & TBase -> : ^ ^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +>Mixin : { new (...args: any[]): Mixin {}>.(Anonymous class); prototype: Mixin {}>.(Anonymous class); } & (new (...args: any[]) => {}) +> : ^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^ +>Mixin : {}>(Base: TBase) => { new (...args: any[]): (Anonymous class); prototype: (Anonymous class); } & TBase +> : ^ ^^^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^ ^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type ReturnTypeOf = V extends (...args: any[])=>infer R ? R : never; >ReturnTypeOf : ReturnTypeOf diff --git a/tests/cases/compiler/narrowTypeByInstanceofAnonymousConstructor1.ts b/tests/cases/compiler/narrowTypeByInstanceofAnonymousConstructor1.ts new file mode 100644 index 0000000000000..31e714a11ff24 --- /dev/null +++ b/tests/cases/compiler/narrowTypeByInstanceofAnonymousConstructor1.ts @@ -0,0 +1,17 @@ +// @strict: true +// @noEmit: true + +// https://github.com/microsoft/TypeScript/issues/57317 + +function MakeClass(someStuff: T) { + return class { + someStuff = someStuff; + }; +} + +const MadeClassNumber = MakeClass(123); + +declare const someInstance: unknown; +if (someInstance instanceof MadeClassNumber) { + someInstance.someStuff; +} diff --git a/tests/cases/fourslash/quickInfoTemplateTag.ts b/tests/cases/fourslash/quickInfoTemplateTag.ts index 9d611823fadfa..34cb11bc26c49 100644 --- a/tests/cases/fourslash/quickInfoTemplateTag.ts +++ b/tests/cases/fourslash/quickInfoTemplateTag.ts @@ -16,6 +16,6 @@ verify.quickInfoAt("", `function myMixin any>(cls: T): { new (...args: any[]): (Anonymous class); - prototype: myMixin.(Anonymous class); + prototype: (Anonymous class); } & T`, "Doc");