Fixed static abstract apply
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
10
src/Trait.ts
10
src/Trait.ts
@@ -14,7 +14,9 @@ export type AddAbstractToImplClass<
|
||||
StaticAbstract extends {},
|
||||
> = (
|
||||
Class<
|
||||
Abstract & InstanceType<ImplClass>,
|
||||
Abstract &
|
||||
InstanceType<ImplClass>,
|
||||
|
||||
ConstructorParameters<ImplClass>
|
||||
> &
|
||||
StaticAbstract &
|
||||
@@ -22,7 +24,7 @@ export type AddAbstractToImplClass<
|
||||
)
|
||||
|
||||
export type RemoveAbstractFromImplClass<
|
||||
ImplClassWithAbstract extends Class<Abstract, []> & { _tag: TraitApplierSuperTag },
|
||||
ImplClassWithAbstract extends Class<Abstract, []> & StaticAbstract & { _tag: TraitApplierSuperTag },
|
||||
Abstract extends {},
|
||||
StaticAbstract extends {},
|
||||
> = (
|
||||
@@ -153,11 +155,11 @@ export namespace Trait {
|
||||
export function trait<
|
||||
Abstract extends {},
|
||||
StaticAbstract extends {},
|
||||
ImplClassWithAbstract extends Class<Abstract, []> & { _tag: TraitApplierSuperTag },
|
||||
ImplClassWithAbstract extends Class<Abstract, []> & StaticAbstract & { _tag: TraitApplierSuperTag },
|
||||
>(
|
||||
abstract: Opaque<Abstract, AbstractTag>,
|
||||
staticAbstract: Opaque<StaticAbstract, AbstractTag>,
|
||||
apply: (Super: AbstractClass<Abstract> & { _tag: TraitApplierSuperTag }) => ImplClassWithAbstract,
|
||||
apply: (Super: AbstractClass<Abstract> & StaticAbstract & { _tag: TraitApplierSuperTag }) => ImplClassWithAbstract,
|
||||
) {
|
||||
return new Trait(
|
||||
emptyTraitExpression,
|
||||
|
||||
@@ -55,7 +55,7 @@ export class TraitExpression<
|
||||
This extends TraitExpression<typeof TraitExpression.NullSuperclass, any, any>,
|
||||
SubtraitAbstract extends Implements<This>,
|
||||
SubtraitStaticAbstract extends ImplementsStatic<This>,
|
||||
SubtraitImplClassWithAbstract extends Class<SubtraitAbstract, []> & { _tag: TraitApplierSuperTag },
|
||||
SubtraitImplClassWithAbstract extends Class<SubtraitAbstract, []> & SubtraitStaticAbstract & { _tag: TraitApplierSuperTag },
|
||||
>(
|
||||
this: This,
|
||||
abstract: (expression: This) => Opaque<SubtraitAbstract, AbstractTag>,
|
||||
|
||||
Reference in New Issue
Block a user