This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { Schema as S } from "@effect/schema"
|
||||
import { Simplify } from "type-fest"
|
||||
import { Trait, TraitTuple } from "../Trait"
|
||||
import { StaticImplements, TraitExpression } from "../TraitExpression"
|
||||
import { StaticImplements, TraitExpressionLike } from "../TraitExpression"
|
||||
import { Extend } from "../util"
|
||||
|
||||
|
||||
@@ -16,6 +16,10 @@ export class EffectSchemaTraitExpression<
|
||||
Static extends object,
|
||||
|
||||
const Traits extends readonly Trait<any, any, any, any>[],
|
||||
>
|
||||
implements TraitExpressionLike<
|
||||
S.Class<unknown, Fields, A, I, R, C, Inherited, Proto> & Static,
|
||||
Traits
|
||||
> {
|
||||
constructor(
|
||||
readonly superclass: S.Class<unknown, Fields, A, I, R, C, Inherited, Proto> & Static,
|
||||
@@ -54,9 +58,9 @@ export class EffectSchemaTraitExpression<
|
||||
}
|
||||
|
||||
|
||||
staticImplements(_target: StaticImplements<TraitExpression<typeof this.superclass, Traits>>, _context: any) {}
|
||||
staticImplements(_target: StaticImplements<typeof this>, _context: any) {}
|
||||
|
||||
get staticImplementsStage2() {
|
||||
return (_target: StaticImplements<TraitExpression<typeof this.superclass, Traits>>) => {}
|
||||
return (_target: StaticImplements<typeof this>) => {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ const userExp = effectSchemaExpression
|
||||
|
||||
@userExp.staticImplements
|
||||
class User extends userExp.extends<User>() implements Implements<typeof userExp> {
|
||||
aMethodThatShouldBeInherited() {}
|
||||
static aStaticMethodThatShouldBeInherited() {}
|
||||
}
|
||||
|
||||
@@ -25,3 +26,5 @@ const adminExp = effectSchemaExpression
|
||||
@adminExp.staticImplements
|
||||
class Admin extends adminExp.extends<Admin>() implements Implements<typeof adminExp> {
|
||||
}
|
||||
|
||||
new Admin({ id: 0n, role: "Admin" }).aMethodThatShouldBeInherited()
|
||||
|
||||
Reference in New Issue
Block a user