mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-07-24 05:05:00 +00:00
fix: infinite loop in simplifying recursive functions (#246)
* fix: infinite loop in simplifying recursive functions * dev: update snapshot
This commit is contained in:
parent
25ae4afcbb
commit
b0c71a0961
4 changed files with 23 additions and 4 deletions
|
@ -1457,10 +1457,13 @@ impl<'a, 'b> TypeSimplifier<'a, 'b> {
|
|||
match &w.kind {
|
||||
FlowVarKind::Weak(w) => {
|
||||
let w = w.read();
|
||||
if pol {
|
||||
self.positives.insert(v.0);
|
||||
let inserted = if pol {
|
||||
self.positives.insert(v.0)
|
||||
} else {
|
||||
self.negatives.insert(v.0);
|
||||
self.negatives.insert(v.0)
|
||||
};
|
||||
if !inserted {
|
||||
return;
|
||||
}
|
||||
|
||||
if pol {
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
// path: base.typ
|
||||
#let a(x) = a;
|
||||
-----
|
||||
#import "base.typ": *
|
||||
#let f() = a()
|
|
@ -0,0 +1,11 @@
|
|||
---
|
||||
source: crates/tinymist-query/src/analysis.rs
|
||||
expression: result
|
||||
input_file: crates/tinymist-query/src/fixtures/type_check/recursive.typ
|
||||
---
|
||||
"a" = Any
|
||||
"f" = () -> Any
|
||||
---
|
||||
27..28 -> @f
|
||||
33..34 -> (@a | (Any) -> Any)
|
||||
33..36 -> Any
|
Loading…
Add table
Add a link
Reference in a new issue