fixing the bug in previous commit

Signed-off-by: Jakub Doka <jakub.doka2@gmail.com>
This commit is contained in:
Jakub Doka 2024-12-21 17:14:33 +01:00
parent af19f4e30d
commit d220823d78
No known key found for this signature in database
GPG key ID: C6E9A89936B8C143

View file

@ -851,12 +851,15 @@ impl<'a> Codegen<'a> {
if let Some((captures, capture_tuple)) = self.tys.captures_of(piter, f)
&& let Some(idx) = captures.iter().position(|&cid| cid.id == id)
{
let ty = if captures[idx].is_ct {
ty::Id::TYPE
if captures[idx].is_ct {
let ty = self.tys.ins.args[capture_tuple.range().start + idx];
break Some(self.ci.nodes.new_const_lit(ty::Id::TYPE, ty));
} else {
self.tys.ins.args[capture_tuple.range().start + idx]
};
break Some(Value::new(NEVER).ty(ty));
break Some(
Value::new(NEVER)
.ty(self.tys.ins.args[capture_tuple.range().start + idx]),
);
}
}
piter = match self.tys.parent_of(piter) {