Working expresses

This commit is contained in:
Julien Valverdé
2024-02-01 03:41:18 +01:00
parent a82c978c9e
commit 288969a789
3 changed files with 72 additions and 55 deletions

View File

@@ -1,6 +1,4 @@
import { Booleans, Call, Compose, ComposeLeft, Match, Pipe, Tuples } from "hotscript"
import { Implements, TraitAbstractMembers, TraitAbstractMembersFn, expresses, extendsAndExpresses, trait } from "."
import { CheckExtendableFn, ExtendFn, Extendable, ExtendableFn, SimplifyFn } from "./util"
import { Implements, TraitAbstractMembers, extendsAndExpresses, trait } from "."
const PrintsHelloOnNew = trait()(Super =>
@@ -45,7 +43,8 @@ const ActiveStatefulSubscription = trait<ActiveStatefulSubscriptionAbstractMembe
class TestSuperclass {
id: number = 69
// id: number = 69
static test = 69
}
@@ -54,11 +53,7 @@ const exp = extendsAndExpresses(
Identifiable<bigint>(),
// Identifiable<number>()
)
type ExpImpl = Implements<typeof exp>
type ExpAbstractMembers = Pipe<typeof exp.traits, [
Tuples.Map<TraitAbstractMembersFn>,
]>
type ExpExtendable = Extendable<ExpAbstractMembers>
// type ExpImpl = ImplStaticMembersExtendable<typeof TestSuperclass, typeof exp.traits>
class User extends exp.extends() implements Implements<typeof exp> {
id: bigint = -1n