From a9afb6d24e4b24159c4f3232ba8afabdb99281e9 Mon Sep 17 00:00:00 2001 From: Greg Shuflin Date: Sun, 21 Nov 2021 00:45:22 -0800 Subject: [PATCH] Fix representation of symbol error --- schala-lang/src/reduced_ir/mod.rs | 4 ++-- schala-lang/src/tree_walk_eval/test.rs | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/schala-lang/src/reduced_ir/mod.rs b/schala-lang/src/reduced_ir/mod.rs index 3be4ad8..06cb705 100644 --- a/schala-lang/src/reduced_ir/mod.rs +++ b/schala-lang/src/reduced_ir/mod.rs @@ -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(); diff --git a/schala-lang/src/tree_walk_eval/test.rs b/schala-lang/src/tree_walk_eval/test.rs index 954691c..ec155d1 100644 --- a/schala-lang/src/tree_walk_eval/test.rs +++ b/schala-lang/src/tree_walk_eval/test.rs @@ -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#"