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

Method check_const

crates/kernel/src/check.rs:73–88  ·  view source on GitHub ↗

Type-check a single constant. Clears per-constant caches first.

(&mut self, id: &KId<M>)

Source from the content-addressed store, hash-verified

71
72 /// Type-check a single constant. Clears per-constant caches first.
73 pub fn check_const(&mut self, id: &KId<M>) -> Result<(), TcError<M>>
74 where
75 M::MField<Vec<ix_common::env::Name>>: CheckDupLevelParams,
76 {
77 let c = self.get_const(id)?;
78 if let Some(block) = self.coordinated_block_for(&c)? {
79 if let Some(result) = self.env.block_check_results.get(&block).cloned() {
80 return result;
81 }
82 let result = self.check_block_body(&block, id);
83 self.env.block_check_results.insert(block, result.clone());
84 return result;
85 }
86
87 self.check_const_member_fresh(id)
88 }
89
90 fn check_const_member_fresh(&mut self, id: &KId<M>) -> Result<(), TcError<M>>
91 where

Calls 7

coordinated_block_forMethod · 0.80
check_block_bodyMethod · 0.80
get_constMethod · 0.45
getMethod · 0.45
insertMethod · 0.45
cloneMethod · 0.45