feat: Finish up assert feature

Better error reporing on NonFunctionalApplication Error
Refactor redundant code
Add handling of whens with one clause.
This commit is contained in:
Kasey White
2023-01-29 05:21:55 -05:00
parent 4c8089c28a
commit afd040fda5
6 changed files with 454 additions and 464 deletions

View File

@@ -16,8 +16,8 @@ pub enum Error {
EvaluationFailure,
#[error("Attempted to instantiate a non-polymorphic term:\n\n{0:#?}")]
NonPolymorphicInstantiation(Value),
#[error("Attempted to apply a non-function:\n\n{0:#?}")]
NonFunctionalApplication(Value),
#[error("Attempted to apply a non-function:\n\n{0:#?} to argument:\n\n{1:#?}")]
NonFunctionalApplication(Value, Value),
#[error("Type mismatch expected '{0}' got '{1}'")]
TypeMismatch(Type, Type),
#[error("Type mismatch expected '(list a)' got '{0}'")]