This commit is contained in:
30
src/effect/tests.ts
Normal file
30
src/effect/tests.ts
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
import { Schema as S } from "@effect/schema"
|
||||||
|
import { Implements } from "../TraitExpression"
|
||||||
|
import { expression } from "../TraitExpressionBuilder"
|
||||||
|
import { extendsEffectSchemaExpression } from "../effect"
|
||||||
|
|
||||||
|
|
||||||
|
const UserSchema = S.Class<unknown>("User")({
|
||||||
|
id: S.BigIntFromSelf
|
||||||
|
})
|
||||||
|
|
||||||
|
const userExp = expression
|
||||||
|
.extends(UserSchema)
|
||||||
|
.build()
|
||||||
|
|
||||||
|
@userExp.staticImplements
|
||||||
|
class User extends extendsEffectSchemaExpression(userExp)<User>() implements Implements<typeof userExp> {
|
||||||
|
static aStaticMethodThatShouldBeInherited() {}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const AdminSchema = User.extend<unknown>("Admin")({
|
||||||
|
})
|
||||||
|
|
||||||
|
const adminExp = expression
|
||||||
|
.extends(AdminSchema)
|
||||||
|
.build()
|
||||||
|
|
||||||
|
@adminExp.staticImplements
|
||||||
|
class Admin extends extendsEffectSchemaExpression(adminExp)<Admin>() implements Implements<typeof adminExp> {
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user