Fix representation of symbol error

This commit is contained in:
Greg Shuflin 2021-11-21 00:45:22 -08:00
parent 8d5858d3d2
commit a9afb6d24e
2 changed files with 3 additions and 5 deletions

View File

@ -145,7 +145,7 @@ impl<'a, 'b> Reducer<'a, 'b> {
NamedStruct { name, fields } => {
let symbol = match self.symbol_table.lookup_symbol(&name.id) {
Some(symbol) => symbol,
None => return Expression::ReductionError(format!("No symbol found for {:?}", name)),
None => return Expression::ReductionError(format!("No symbol found for {}", name)),
};
let (tag, type_id) = match symbol.spec() {
SymbolSpec::RecordConstructor { tag, type_id } => (tag, type_id),
@ -330,7 +330,7 @@ impl<'a, 'b> Reducer<'a, 'b> {
let symbol = match self.symbol_table.lookup_symbol(&qualified_name.id) {
Some(s) => s,
None =>
return Expression::ReductionError(format!("No symbol found for name: {:?}", qualified_name)),
return Expression::ReductionError(format!("No symbol found for name: `{}`", qualified_name)),
};
let def_id = symbol.def_id();

View File

@ -95,9 +95,7 @@ trad()"#,
"30",
);
//TODO this shouldn't depend on details of id assignment
let err =
"No symbol found for name: QualifiedName { id: Id { idx: 22, t: PhantomData }, components: [\"a\"] }";
let err = "No symbol found for name: `a`";
eval_assert_failure(
r#"