(
&mut self,
c: &KConst<M>,
mut timing: Option<&mut ValidationTiming>,
)
| 433 | self.check_recursor_member(id)?; |
| 434 | Ok(()) |
| 435 | }, |
| 436 | |
| 437 | KConst::Indc { ty, .. } => { |
| 438 | let t = self.infer(ty)?; |
| 439 | self.ensure_sort(&t)?; |
| 440 | self.check_inductive_member(id)?; |
| 441 | Ok(()) |
| 442 | }, |
| 443 | |
| 444 | KConst::Ctor { ty, induct, .. } => { |
| 445 | let t = self.infer(ty)?; |
| 446 | self.ensure_sort(&t)?; |
| 447 | // Validate against the parent inductive (A1–A4 checks). |
| 448 | // This ensures standalone ctorInfo is rejected if it doesn't |
| 449 | // match its declared inductive. |
| 450 | let induct = induct.clone(); |
| 451 | self.check_ctor_against_inductive_member(id, &induct)?; |
| 452 | Ok(()) |
| 453 | }, |
| 454 | } |
| 455 | } |
| 456 | |
| 457 | fn coordinated_block_for( |
| 458 | &mut self, |
| 459 | c: &KConst<M>, |
| 460 | ) -> Result<Option<KId<M>>, TcError<M>> { |
| 461 | match c { |
| 462 | KConst::Defn { block, .. } => { |
| 463 | self.coordinated_block_if_kind(block, CheckBlockKind::Defn) |
| 464 | }, |
| 465 | KConst::Indc { block, .. } => { |
| 466 | self.coordinated_block_if_kind(block, CheckBlockKind::Inductive) |
| 467 | }, |
| 468 | KConst::Ctor { induct, .. } => { |
| 469 | let Some(parent) = self.try_get_const(induct)? else { |
| 470 | return Ok(None); |
| 471 | }; |
| 472 | match parent { |
| 473 | KConst::Indc { block, .. } => { |
| 474 | self.coordinated_block_if_kind(&block, CheckBlockKind::Inductive) |
| 475 | }, |
| 476 | _ => Ok(None), |
| 477 | } |
| 478 | }, |
| 479 | KConst::Recr { block, .. } => { |
| 480 | self.coordinated_block_if_kind(block, CheckBlockKind::Recursor) |
| 481 | }, |
| 482 | KConst::Axio { .. } | KConst::Quot { .. } => Ok(None), |
| 483 | } |
| 484 | } |
| 485 | |
| 486 | fn coordinated_block_if_kind( |
| 487 | &mut self, |
no test coverage detected