Revise desugaring following feedback
- We now consistently desugar an expect in the last position as
`Void`. Regardless of the pattern. Desugaring to a boolean value is
deemed too confusing.
- This commit also removes the desugaring for let-binding. It's only
ever allowed for _expect_ which then behaves like a side effect.
- We also now allow tests to return either `Bool` or `Void`. A test
that returns `Void` is treated the same as a test returning `True`.
This commit is contained in:
@@ -39,7 +39,11 @@ impl EvalResult {
|
||||
} else {
|
||||
self.result.is_err()
|
||||
|| matches!(self.result, Ok(Term::Error))
|
||||
|| !matches!(self.result, Ok(Term::Constant(ref con)) if matches!(con.as_ref(), Constant::Bool(true)))
|
||||
|| !matches!(
|
||||
self.result,
|
||||
Ok(Term::Constant(ref con))
|
||||
if matches!(con.as_ref(), Constant::Bool(true)) || matches!(con.as_ref(), Constant::Unit)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user