diff --git a/lang/src/son.rs b/lang/src/son.rs index 1c933744..f9242fa5 100644 --- a/lang/src/son.rs +++ b/lang/src/son.rs @@ -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) {