From 0c0690e86ee6c3e14c75eab00ba5faf556e0bebd Mon Sep 17 00:00:00 2001 From: greg Date: Tue, 14 Aug 2018 21:53:57 -0700 Subject: [PATCH] Provide error message here --- schala-lang/src/reduced_ast.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/schala-lang/src/reduced_ast.rs b/schala-lang/src/reduced_ast.rs index 596a590..893e7b7 100644 --- a/schala-lang/src/reduced_ast.rs +++ b/schala-lang/src/reduced_ast.rs @@ -155,7 +155,7 @@ fn reduce_if_expression(discriminator: &Discriminator, body: &IfExpressionBody, let first_alt: Alternative = match pat { Pattern::TupleStruct(name, subpatterns) => { - let symbol = symbol_table.values.get(name).unwrap(); + let symbol = symbol_table.values.get(name).expect(&format!("Symbol {} not found", name)); let tag = match symbol.spec { SymbolSpec::DataConstructor { index, .. } => index.clone(), _ => panic!("Bad symbol"),