MCPcopy Create free account
hub / github.com/argumentcomputer/ix / coordinated_block_for

Method coordinated_block_for

crates/kernel/src/check.rs:257–284  ·  view source on GitHub ↗
(
    &mut self,
    c: &KConst<M>,
  )

Source from the content-addressed store, hash-verified

255 }
256
257 fn coordinated_block_for(
258 &mut self,
259 c: &KConst<M>,
260 ) -> Result<Option<KId<M>>, TcError<M>> {
261 match c {
262 KConst::Defn { block, .. } => {
263 self.coordinated_block_if_kind(block, CheckBlockKind::Defn)
264 },
265 KConst::Indc { block, .. } => {
266 self.coordinated_block_if_kind(block, CheckBlockKind::Inductive)
267 },
268 KConst::Ctor { induct, .. } => {
269 let Some(parent) = self.try_get_const(induct)? else {
270 return Ok(None);
271 };
272 match parent {
273 KConst::Indc { block, .. } => {
274 self.coordinated_block_if_kind(&block, CheckBlockKind::Inductive)
275 },
276 _ => Ok(None),
277 }
278 },
279 KConst::Recr { block, .. } => {
280 self.coordinated_block_if_kind(block, CheckBlockKind::Recursor)
281 },
282 KConst::Axio { .. } | KConst::Quot { .. } => Ok(None),
283 }
284 }
285
286 fn coordinated_block_if_kind(
287 &mut self,

Callers 2

check_constMethod · 0.80

Calls 2

try_get_constMethod · 0.45

Tested by

no test coverage detected