Count the number of leading foralls in a type.
(&mut self, ty: &KExpr<M>)
| 730 | if u64_to_usize::<M>(c.lvls())? != us.len() { |
| 731 | return Err(TcError::UnivParamMismatch { |
| 732 | expected: c.lvls(), |
| 733 | got: us.len(), |
| 734 | }); |
| 735 | } |
| 736 | for u in us { |
| 737 | let univ_start = timing.as_ref().map(|_| Instant::now()); |
| 738 | self.validate_univ_params_seen(u, lvl_bound, &mut seen_univs)?; |
| 739 | if let (Some(t), Some(start)) = (timing.as_deref_mut(), univ_start) |
| 740 | { |
| 741 | t.univ += start.elapsed(); |
| 742 | } |
| 743 | } |
| 744 | }, |
| 745 | ExprData::App(f, a, _) => { |
| 746 | stack.push((f, depth)); |
| 747 | stack.push((a, depth)); |
| 748 | }, |
| 749 | ExprData::Lam(_, _, ty, body, _) | ExprData::All(_, _, ty, body, _) => { |
| 750 | stack.push((ty, depth)); |
| 751 | let body_depth = depth.checked_add(1).ok_or_else(|| { |
| 752 | TcError::Other("binder depth overflow during validation".into()) |
| 753 | })?; |
| 754 | stack.push((body, body_depth)); |
| 755 | }, |
| 756 | ExprData::Let(_, ty, val, body, _, _) => { |
| 757 | stack.push((ty, depth)); |
| 758 | stack.push((val, depth)); |
| 759 | let body_depth = depth.checked_add(1).ok_or_else(|| { |
| 760 | TcError::Other("binder depth overflow during validation".into()) |
| 761 | })?; |
| 762 | stack.push((body, body_depth)); |
no test coverage detected