Look up a variable's types. Returns an empty slice when the variable has not been assigned.
(&self, var_name: &str)
| 1845 | /// Look up a variable's types. Returns an empty slice when the |
| 1846 | /// variable has not been assigned. |
| 1847 | pub fn get(&self, var_name: &str) -> &[ResolvedType] { |
| 1848 | self.locals |
| 1849 | .get(&atom(var_name)) |
| 1850 | .map_or(&[], |v| v.as_slice()) |
| 1851 | } |
| 1852 | |
| 1853 | /// Check whether a variable exists in scope (even if its type list is empty). |
| 1854 | pub fn contains(&self, var_name: &str) -> bool { |