mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-08-03 17:58:17 +00:00
fix: determine name_started
in sig constructors (#1038)
* fix: name_started in sig constructors * fix: test it
This commit is contained in:
parent
97541d54f8
commit
a4de68a1ca
6 changed files with 12 additions and 11 deletions
|
@ -1,8 +1,8 @@
|
|||
---
|
||||
source: crates/tinymist-query/src/analysis.rs
|
||||
description: "Check on \"(\" (30)"
|
||||
expression: literal_type
|
||||
expression: post_ty
|
||||
input_file: crates/tinymist-query/src/fixtures/post_type_check/text_font2.typ
|
||||
snapshot_kind: text
|
||||
---
|
||||
TextFont
|
||||
( ⪰ "Test" ⪯ TextFont)
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
---
|
||||
source: crates/tinymist-query/src/analysis.rs
|
||||
description: "Check on \"(\" (31)"
|
||||
expression: literal_type
|
||||
expression: post_ty
|
||||
input_file: crates/tinymist-query/src/fixtures/post_type_check/text_font4.typ
|
||||
snapshot_kind: text
|
||||
---
|
||||
TextFont
|
||||
( ⪰ "Test" ⪯ TextFont)
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
---
|
||||
source: crates/tinymist-query/src/analysis.rs
|
||||
description: "Check on \"\\\"Test\\\"\" (31)"
|
||||
expression: literal_type
|
||||
expression: post_ty
|
||||
input_file: crates/tinymist-query/src/fixtures/post_type_check/text_font_element4.typ
|
||||
snapshot_kind: text
|
||||
---
|
||||
TextFont
|
||||
( ⪰ "Test" ⪯ TextFont)
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
---
|
||||
source: crates/tinymist-query/src/analysis.rs
|
||||
description: "Check on \"(\" (105)"
|
||||
expression: literal_type
|
||||
expression: post_ty
|
||||
input_file: crates/tinymist-query/src/fixtures/post_type_check/user_func.typ
|
||||
snapshot_kind: text
|
||||
---
|
||||
TextFont
|
||||
( ⪰ TextFont ⪯ "Test")
|
||||
|
|
|
@ -7,7 +7,7 @@ snapshot_kind: text
|
|||
"a" = (1, )
|
||||
"f" = ((Type(bytes) | Type(decimal) | Type(float) | Type(int) | Type(label) | Type(str) | Type(type) | Type(version))) => Type(str)
|
||||
"" = ((Type(bytes) | Type(decimal) | Type(float) | Type(int) | Type(label) | Type(str) | Type(type) | Type(version))) => Type(str)
|
||||
"x" = Any
|
||||
"x" = Type(int)
|
||||
"b" = (Type(str), )
|
||||
=====
|
||||
5..6 -> @a
|
||||
|
|
|
@ -777,7 +777,7 @@ impl SigTy {
|
|||
inputs: Interned::new(vec![inp]),
|
||||
body: Some(ret),
|
||||
names: NameBone::empty(),
|
||||
name_started: 0,
|
||||
name_started: 1,
|
||||
spread_left: false,
|
||||
spread_right: false,
|
||||
})
|
||||
|
@ -791,11 +791,12 @@ impl SigTy {
|
|||
} else {
|
||||
Ty::Tuple(elems.clone())
|
||||
};
|
||||
let name_started = elems.len() as u32;
|
||||
Interned::new(Self {
|
||||
inputs: elems,
|
||||
body: Some(ret),
|
||||
names: NameBone::empty(),
|
||||
name_started: 0,
|
||||
name_started,
|
||||
spread_left: false,
|
||||
spread_right: false,
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue