mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-08-04 18:28:02 +00:00
feat: rec
This commit is contained in:
parent
51e0dc87f8
commit
f33f61da5e
3 changed files with 25 additions and 0 deletions
14
crates/tinymist-analysis/src/fixtures/type_schema/rec.typ
Normal file
14
crates/tinymist-analysis/src/fixtures/type_schema/rec.typ
Normal 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,
|
||||
),
|
||||
)
|
||||
};
|
|
@ -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
|
|
@ -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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue