Expresses work
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { Fn, Pipe, Tuples } from "hotscript"
|
||||
import { Call, Fn, Pipe, Tuples } from "hotscript"
|
||||
import { AbstractClass, Opaque, Simplify } from "type-fest"
|
||||
import { Trait, TraitAbstractMembersFn, TraitApplierSuperTag } from "."
|
||||
import { Trait, TraitAbstractMembersFn, TraitApplierSuperTag, TraitImplInstanceFn } from "."
|
||||
import { ExtendFn } from "./util"
|
||||
|
||||
|
||||
@@ -13,7 +13,16 @@ class TraitsExpression<
|
||||
readonly traits: Traits,
|
||||
) {}
|
||||
|
||||
extends() {
|
||||
extends(): (
|
||||
AbstractClass<
|
||||
Call<ExtendFn, [
|
||||
InstanceType<Super>,
|
||||
...Call<Tuples.Map<TraitImplInstanceFn>, Traits>,
|
||||
]>,
|
||||
|
||||
ConstructorParameters<Super>
|
||||
>
|
||||
) {
|
||||
return this.traits.reduce(
|
||||
(previous, trait) => trait.apply(previous),
|
||||
this.superclass as Opaque<Super, TraitApplierSuperTag>,
|
||||
|
||||
Reference in New Issue
Block a user