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>>],
|
_: &[Arc<RwLock<TopLevelDef>>],
|
||||||
_: &PrimitiveStore,
|
_: &PrimitiveStore,
|
||||||
str: StrRef,
|
str: StrRef,
|
||||||
) -> Option<Type> {
|
) -> Result<Type, String> {
|
||||||
self.id_to_type.get(&str).cloned()
|
self.id_to_type.get(&str).cloned().ok_or_else(|| format!("cannot find symbol `{}`", str))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_symbol_value<'ctx, 'a>(
|
fn get_symbol_value<'ctx, 'a>(
|
||||||
|
@ -45,9 +45,13 @@ impl SymbolResolver for Resolver {
|
|||||||
_: &[Arc<RwLock<TopLevelDef>>],
|
_: &[Arc<RwLock<TopLevelDef>>],
|
||||||
_: &PrimitiveStore,
|
_: &PrimitiveStore,
|
||||||
str: StrRef,
|
str: StrRef,
|
||||||
) -> Option<Type> {
|
) -> Result<Type, String> {
|
||||||
let ret = self.0.id_to_type.lock().get(&str).cloned();
|
self.0
|
||||||
ret
|
.id_to_type
|
||||||
|
.lock()
|
||||||
|
.get(&str)
|
||||||
|
.cloned()
|
||||||
|
.ok_or_else(|| format!("cannot find symbol `{}`", str))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_symbol_value<'ctx, 'a>(
|
fn get_symbol_value<'ctx, 'a>(
|
||||||
|
@ -29,8 +29,8 @@ impl SymbolResolver for Resolver {
|
|||||||
_: &[Arc<RwLock<TopLevelDef>>],
|
_: &[Arc<RwLock<TopLevelDef>>],
|
||||||
_: &PrimitiveStore,
|
_: &PrimitiveStore,
|
||||||
str: StrRef,
|
str: StrRef,
|
||||||
) -> Option<Type> {
|
) -> Result<Type, String> {
|
||||||
self.id_to_type.get(&str).cloned()
|
self.id_to_type.get(&str).cloned().ok_or_else(|| format!("cannot find symbol `{}`", str))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn get_symbol_value<'ctx, 'a>(
|
fn get_symbol_value<'ctx, 'a>(
|
||||||
|
Loading…
Reference in New Issue
Block a user