BuildTraitExpression refactoring
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:
@@ -16,35 +16,25 @@ type SpreadSupertraits<T> = (
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
type InstanceExtendable<
|
|
||||||
Superclass extends AbstractClass<object>,
|
|
||||||
Traits extends Trait<any, any, any, any>[],
|
|
||||||
> = (
|
|
||||||
Extendable<[
|
|
||||||
InstanceType<Superclass>,
|
|
||||||
...TraitTuple.MapInstance<Traits>,
|
|
||||||
]>
|
|
||||||
)
|
|
||||||
|
|
||||||
type StaticMembersExtendable<
|
|
||||||
Superclass extends AbstractClass<object>,
|
|
||||||
Traits extends Trait<any, any, any, any>[],
|
|
||||||
> = (
|
|
||||||
Extendable<[
|
|
||||||
StaticMembers<Superclass>,
|
|
||||||
...TraitTuple.MapStaticMembers<Traits>,
|
|
||||||
]>
|
|
||||||
)
|
|
||||||
|
|
||||||
type BuildTraitExpression<
|
type BuildTraitExpression<
|
||||||
Superclass extends AbstractClass<object>,
|
Superclass extends AbstractClass<object>,
|
||||||
Traits extends Trait<any, any, any, any>[],
|
Traits extends Trait<any, any, any, any>[],
|
||||||
> = (
|
> = (
|
||||||
InstanceExtendable<Superclass, Traits> extends false
|
Extendable<TraitTuple.MapAbstract<Traits>> extends false
|
||||||
? "Type conflict on the instance side."
|
? "Type conflict between the traits abstract definitions."
|
||||||
: StaticMembersExtendable<Superclass, Traits> extends false
|
: Extendable<TraitTuple.MapStaticAbstract<Traits>> extends false
|
||||||
? "Type conflict on the static side."
|
? "Type conflict between the traits static abstract definitions."
|
||||||
: TraitExpression<Superclass, Traits>
|
: Extendable<[
|
||||||
|
InstanceType<Superclass>,
|
||||||
|
...TraitTuple.MapImplInstance<Traits>,
|
||||||
|
]> extends false
|
||||||
|
? "Type conflict between the traits implementation instance and/or the superclass instance."
|
||||||
|
: Extendable<[
|
||||||
|
StaticMembers<Superclass>,
|
||||||
|
...TraitTuple.MapImplStaticMembers<Traits>,
|
||||||
|
]> extends false
|
||||||
|
? "Type conflict between the traits implementation static members and/or the superclass static members."
|
||||||
|
: TraitExpression<Superclass, Traits>
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user