Added record extension field punning

This commit is contained in:
Brandon Dyck 2023-07-11 13:14:02 -06:00
parent fc710d038f
commit 7741b7c4ad

View File

@ -532,8 +532,8 @@ public class Interpreter : AST.IExprVisitor<Env, object>
} }
extLabels.Add(label); extLabels.Add(label);
if (extension.Value == null) throw new NotImplementedException(); var extensionValue = extension.Value == null ? env[extension.Name] : evaluate(env, extension.Value);
rec = rec.Extend(label, evaluate(env, extension.Value)); rec = rec.Extend(label, extensionValue);
} }
return rec; return rec;