We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents cbcc7bb + 16919da commit f6fff25Copy full SHA for f6fff25
clarity/src/vm/analysis/type_checker/contexts.rs
@@ -86,6 +86,20 @@ impl TypeMap {
86
}
87
88
89
+ /// Like set_type but forcing a change if already set
90
+ pub fn overwrite_type(&mut self, expr: &SymbolicExpression, type_sig: TypeSignature) {
91
+ if let TypeMapDataType::Map(ref mut map) = self.map {
92
+ map.insert(expr.id, type_sig);
93
+ }
94
95
+
96
+ pub fn get_type(&self, expr: &SymbolicExpression) -> Option<&TypeSignature> {
97
+ match self.map {
98
+ TypeMapDataType::Map(ref map) => map.get(&expr.id),
99
+ _ => None,
100
101
102
103
pub fn get_type_expected(&self, expr: &SymbolicExpression) -> Option<&TypeSignature> {
104
match self.map {
105
TypeMapDataType::Map(ref map) => map.get(&expr.id),
0 commit comments