Check with custom primitives (needed for Nat literal tests etc.)
( env: &mut KEnv<Meta>, id: &MId, prims: super::primitive::Primitives<Meta>, )
| 244 | |
| 245 | /// Check with custom primitives (needed for Nat literal tests etc.) |
| 246 | pub fn check_accepts_with_prims( |
| 247 | env: &mut KEnv<Meta>, |
| 248 | id: &MId, |
| 249 | prims: super::primitive::Primitives<Meta>, |
| 250 | ) { |
| 251 | let mut tc = TypeChecker::new(env); |
| 252 | tc.prims = prims; |
| 253 | match tc.check_const(id) { |
| 254 | Ok(()) => {}, |
| 255 | Err(e) => panic!("expected {id} to be accepted, got error: {e:?}"), |
| 256 | } |
| 257 | } |
| 258 | |
| 259 | /// Build Primitives resolved from a test environment. |
| 260 | /// The env should contain all the primitives the test needs. |
no test coverage detected