diff options
| author | Edvard Thörnros <edvard.thornros@gmail.com> | 2021-03-08 21:57:52 +0100 |
|---|---|---|
| committer | Edvard Thörnros <edvard.thornros@gmail.com> | 2021-03-08 21:57:52 +0100 |
| commit | 4e6ef21576d9ec6a8861246464b1905819b68efe (patch) | |
| tree | c0e07b88e9257783990895dfc6d3ab559e82b712 /src/vm.rs | |
| parent | 858d5c1756b64f4973588424b8ba375136740510 (diff) | |
| download | sylt-4e6ef21576d9ec6a8861246464b1905819b68efe.tar.gz | |
fix some nice tests for the nullable_types
Diffstat (limited to 'src/vm.rs')
| -rw-r--r-- | src/vm.rs | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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 => { |
