From 4e6ef21576d9ec6a8861246464b1905819b68efe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edvard=20Th=C3=B6rnros?= Date: Mon, 8 Mar 2021 21:57:52 +0100 Subject: fix some nice tests for the nullable_types --- src/vm.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/vm.rs') diff --git a/src/vm.rs b/src/vm.rs index 2859d83..0595639 100644 --- a/src/vm.rs +++ b/src/vm.rs @@ -669,6 +669,10 @@ impl VM { let ty = self.ty(ty); let top_type = self.stack.last().unwrap().into(); match (ty, top_type) { + (a, b) if matches!(a, Type::Union(_)) && a == &b => { + let last = self.stack.len() - 1; + self.stack[last] = Value::from(a); + } (Type::Unknown, top_type) if top_type != Type::Unknown => {} (a, b) if a != &b => { -- cgit v1.2.1