feat: rec

This commit is contained in:
Myriad-Dreamin 2025-06-22 13:49:53 +08:00
parent 51e0dc87f8
commit f33f61da5e
3 changed files with 25 additions and 0 deletions

View file

@ -0,0 +1,14 @@
#import "typings.typ": *
#let V = tv("V");
#let dict-type(V: V) = {
let Self = Self.with(V)
rec(
name: "dictionary",
scope: (
len: (self: Self) => int,
),
)
};

View file

@ -0,0 +1,7 @@
---
source: crates/tinymist-analysis/src/ty/scheme.rs
expression: result
input_file: crates/tinymist-analysis/src/fixtures/type_schema/rec.typ
---
"V" = @V
"dict-type" = ("V": @V) => Any

View file

@ -128,6 +128,10 @@ impl TySchemeWorker<'_> {
Interned::new(Decl::lit_at(name.as_str(), args.span)),
))
}
"rec" => {
// let ty = self.define(k, &args.eat::<Value>().ok()??);
todo!()
}
"arr" => {
let ty = self.define(k, &args.eat::<Value>().ok()??);
Ty::Array(Interned::new(ty))