feat: partial func (WIP)

This commit is contained in:
2025-06-20 21:48:58 +08:00
parent d875951c09
commit 75e8705098
6 changed files with 88 additions and 48 deletions

View File

@@ -1,3 +1,4 @@
use tracing::{event, span, Level};
use derive_more::Unwrap;
use ecow::EcoString;
use hashbrown::{HashMap, HashSet};
@@ -170,14 +171,14 @@ impl DowngradeContext {
pub fn new_dep(&mut self, this: Index, dep: Dep) -> Result<()> {
#[cfg(debug_assertions)]
println!("{this:?} => {dep:?}");
event!(Level::DEBUG, "{this:?} => {dep:?}");
match this {
Index::Thunk(idx) => {
if dep == Dep::Thunk(idx) && !matches!(self.thunks[idx].0, Ir::List(_)) {
/* if dep == Dep::Thunk(idx) && !matches!(self.thunks[idx].0, Ir::List(_)) {
return Err(Error::DowngradeError(
"infinite recursion encountered".into(),
));
}
} */
self.thunk_deps[idx].insert(dep.unwrap_thunk())
}
Index::Func(idx) => self.func_deps[idx].insert(dep),