fix: check signature of partially specialized functions (#840)

This commit is contained in:
Myriad-Dreamin 2024-11-18 11:10:12 +08:00 committed by GitHub
parent 78a4117ec6
commit 378d412cf7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 15 additions and 3 deletions

View file

@ -1,3 +1,5 @@
use std::ops::Deref;
use typst::foundations::{self, Func};
use crate::ty::prelude::*;
@ -99,7 +101,12 @@ impl Ty {
results.push(DocSource::Var(ty.clone()));
}
With(ty) => collect(&ty.sig, results),
Select(_ty) => {
Select(ty) => {
// todo: do this correctly
if matches!(ty.select.deref(), "with" | "where") {
collect(&ty.ty, results);
}
// collect(&ty.ty, results)
}
}

View file

@ -47,9 +47,14 @@ impl<'a> Sig<'a> {
}
pub fn shape(self, ctx: &mut impl TyCtxMut) -> Option<SigShape<'a>> {
let (cano_sig, withs) = match self {
let (sig, _is_partialize) = match self {
Sig::Partialize(sig) => (*sig, true),
sig => (sig, false),
};
let (cano_sig, withs) = match sig {
Sig::With { sig, withs, .. } => (*sig, Some(withs)),
_ => (self, None),
sig => (sig, None),
};
let sig_ins = match cano_sig {