Commit 7e95206c authored by Jeff Smits's avatar Jeff Smits

Fixed bug in debug_assert

parent 6d2973a1
......@@ -100,18 +100,14 @@ impl<'d, 'f: 'd> MutContext<'d, 'f> {
"_apply_overlay: Interpreter bug, overlay is leaking a strategy definition"
);
for (name, value) in scope.term {
if let Some(value) = value {
let result = self.match_term(&name, &value);
debug_assert!(
result.is_ok(),
"_apply_overlay: Interpreter bug, overlay has names that were bound underneath"
);
} else {
unreachable!(
"_apply_overlay: Interpreter bug, who put an uninitialised variable in \
my overlay? >:("
)
}
let value = value.expect(
"_apply_overlay: Interpreter bug, unintialised variable in overlay"
);
let result = self.match_term(&name, &value);
debug_assert!(
result.is_ok(),
"_apply_overlay: Interpreter bug, overlay has names that were bound underneath"
);
}
}
......@@ -121,7 +117,11 @@ impl<'d, 'f: 'd> MutContext<'d, 'f> {
"apply_overlay: Interpreter bug, unexpected end of stack",
);
debug_assert!(
scope.kind == ScopeKind::Overlay,
match scope.kind {
ScopeKind::Normal => false,
ScopeKind::Overlay => true,
ScopeKind::InvalidatedOverlay(_) => true,
},
"apply_overlay: Interpreter bug, unexpected non-overlay scope"
);
self._apply_overlay(scope);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment