From 1217e9860eeffeba3b51bdb64170431d8d91d2c7 Mon Sep 17 00:00:00 2001 From: collin Date: Wed, 2 Dec 2020 12:29:32 -0500 Subject: [PATCH] fix nested mutable value bug --- compiler/src/value/value.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/compiler/src/value/value.rs b/compiler/src/value/value.rs index d50f93f2fb..a1ecb7b995 100644 --- a/compiler/src/value/value.rs +++ b/compiler/src/value/value.rs @@ -229,8 +229,15 @@ impl> ConstrainedValue { } } + /// + /// Modifies the `self` [ConstrainedValue] so there are no `mut` keywords wrapping the `self` value. + /// pub(crate) fn get_inner_mut(&mut self) { if let ConstrainedValue::Mutable(inner) = self { + // Recursively remove `mut` keywords. + inner.get_inner_mut(); + + // Modify the value. *self = *inner.clone() } }