Type vacuuming and working classes types

This commit is contained in:
2024-03-08 00:46:59 -05:00
parent a6df78e64f
commit 04fc707bec
11 changed files with 260 additions and 91 deletions

View File

@@ -1,11 +0,0 @@
-- type AccountImpl = {
-- __index: AccountImpl,
-- new: (name: string, balance: number) -> Account,
-- deposit: (self: Account, credit: number) -> (),
-- withdraw: (self: Account, debit: number) -> (),
-- }
-- type Account = typeof(setmetatable({} :: { name: string, balance: number }, {} :: AccountImpl))
type hself<T,U> = {__index: T} & U
export type constructor<T,U> = typeof(setmetatable({} :: T & hself<T,U>, {} :: U))