From 7741b7c4ad9a0b184c4d7afd7b32392b8d63f71f Mon Sep 17 00:00:00 2001 From: Brandon Dyck Date: Tue, 11 Jul 2023 13:14:02 -0600 Subject: [PATCH] Added record extension field punning --- Interpreter.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Interpreter.cs b/Interpreter.cs index e1bad2e..fd90310 100644 --- a/Interpreter.cs +++ b/Interpreter.cs @@ -532,8 +532,8 @@ public class Interpreter : AST.IExprVisitor } extLabels.Add(label); - if (extension.Value == null) throw new NotImplementedException(); - rec = rec.Extend(label, evaluate(env, extension.Value)); + var extensionValue = extension.Value == null ? env[extension.Name] : evaluate(env, extension.Value); + rec = rec.Extend(label, extensionValue); } return rec;