From e4592ddfb22499f457c7c33321c6dab7265a6291 Mon Sep 17 00:00:00 2001 From: Greg Shuflin Date: Tue, 26 Oct 2021 14:53:28 -0700 Subject: [PATCH] Bit of work for record patterns --- schala-lang/language/src/reduced_ir/mod.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/schala-lang/language/src/reduced_ir/mod.rs b/schala-lang/language/src/reduced_ir/mod.rs index 8a37360..2e607d7 100644 --- a/schala-lang/language/src/reduced_ir/mod.rs +++ b/schala-lang/language/src/reduced_ir/mod.rs @@ -356,9 +356,13 @@ impl ast::Pattern { spec => return Err(format!("Unexpected VarOrName symbol: {:?}", spec).into()) } }, - ast::Pattern::Record(_name, _members/*Vec<(Rc, Pattern)>*/) => { - unimplemented!() - }, + ast::Pattern::Record(name, _specified_members/*Vec<(Rc, Pattern)>*/) => { + let symbol = symbol_table.lookup_symbol(&name.id).unwrap(); + match symbol.spec() { + SymbolSpec::RecordConstructor { index: _, members: _, type_id: _ } => unimplemented!(), + spec => return Err(format!("Unexpected Record pattern symbol: {:?}", spec).into()) + } + } }) } }