Get the result sort level of a type after peeling `n` foralls.
(
&mut self,
ty: &KExpr<M>,
n: usize,
)
| 2088 | ))); |
| 2089 | } |
| 2090 | match group.concrete_univs.as_deref() { |
| 2091 | Some(expected) => { |
| 2092 | if expected.len() != us.len() |
| 2093 | || !expected.iter().zip(us).all(|(a, b)| univ_eq(a, b)) |
| 2094 | { |
| 2095 | return Err(TcError::Other( |
| 2096 | "positivity: recursive occurrence has non-uniform universe arguments" |
| 2097 | .into(), |
| 2098 | )); |
| 2099 | } |
| 2100 | }, |
| 2101 | None => { |
| 2102 | for (i, u) in us.iter().enumerate() { |
| 2103 | let expected = |
| 2104 | KUniv::param(i as u64, M::meta_field(ix_common::env::Name::anon())); |
| 2105 | if !univ_eq(u, &expected) { |
| 2106 | return Err(TcError::Other( |
| 2107 | "positivity: recursive occurrence has non-uniform universe arguments" |
| 2108 | .into(), |
| 2109 | )); |
| 2110 | } |
| 2111 | } |
| 2112 | }, |
| 2113 | } |
| 2114 | |
| 2115 | if group.params.len() != n_params { |
| 2116 | return Err(TcError::Other( |
| 2117 | "positivity: recursive occurrence parameter arity disagrees with its family" |
| 2118 | .into(), |
| 2119 | )); |
| 2120 | } |
| 2121 | for (i, (actual, expected)) in |
| 2122 | args[..n_params].iter().zip(&group.params).enumerate() |
no test coverage detected