forked from M-Labs/nac3
nac3core: fix broken tests
This commit is contained in:
parent
4a1a4dc076
commit
ae8f82ccb0
|
@ -46,8 +46,8 @@ impl SymbolResolver for Resolver {
|
|||
_: &[Arc<RwLock<TopLevelDef>>],
|
||||
_: &PrimitiveStore,
|
||||
str: StrRef,
|
||||
) -> Option<Type> {
|
||||
self.id_to_type.get(&str).cloned()
|
||||
) -> Result<Type, String> {
|
||||
self.id_to_type.get(&str).cloned().ok_or_else(|| format!("cannot find symbol `{}`", str))
|
||||
}
|
||||
|
||||
fn get_symbol_value<'ctx, 'a>(
|
||||
|
|
|
@ -45,9 +45,13 @@ impl SymbolResolver for Resolver {
|
|||
_: &[Arc<RwLock<TopLevelDef>>],
|
||||
_: &PrimitiveStore,
|
||||
str: StrRef,
|
||||
) -> Option<Type> {
|
||||
let ret = self.0.id_to_type.lock().get(&str).cloned();
|
||||
ret
|
||||
) -> Result<Type, String> {
|
||||
self.0
|
||||
.id_to_type
|
||||
.lock()
|
||||
.get(&str)
|
||||
.cloned()
|
||||
.ok_or_else(|| format!("cannot find symbol `{}`", str))
|
||||
}
|
||||
|
||||
fn get_symbol_value<'ctx, 'a>(
|
||||
|
|
|
@ -29,8 +29,8 @@ impl SymbolResolver for Resolver {
|
|||
_: &[Arc<RwLock<TopLevelDef>>],
|
||||
_: &PrimitiveStore,
|
||||
str: StrRef,
|
||||
) -> Option<Type> {
|
||||
self.id_to_type.get(&str).cloned()
|
||||
) -> Result<Type, String> {
|
||||
self.id_to_type.get(&str).cloned().ok_or_else(|| format!("cannot find symbol `{}`", str))
|
||||
}
|
||||
|
||||
fn get_symbol_value<'ctx, 'a>(
|
||||
|
|
Loading…
Reference in New Issue