From 1c47d2c4e0e9bd8ff38a7ef4939b78ac4722092b Mon Sep 17 00:00:00 2001 From: tslil Date: Tue, 5 May 2026 11:01:30 +0100 Subject: replace todo! with real errors --- src/checker_state.rs | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'src/checker_state.rs') diff --git a/src/checker_state.rs b/src/checker_state.rs index a8473ff..3404a35 100644 --- a/src/checker_state.rs +++ b/src/checker_state.rs @@ -12,24 +12,33 @@ use std::sync::atomic::{AtomicUsize, Ordering}; pub enum CheckerError { #[display("Unbound: {_0}")] Unbound(String), + #[display("Rebinding: {_0}")] Rebinding(String), + #[display("The following functionality is unimplemented: {_0}")] Unimplemented(String), + #[display("Element {value} claimed to belong to {claimed} but actually belongs to {real}")] WrongSetForElement { value: ElementValue, claimed: Set, real: Set, }, + #[display("Element {element} does belong to set {claimed}: {reason}")] ElementDoesNotBelong { element: Element, claimed: Set, reason: String, }, + + #[display("Case analysis {_0} does not have consistent set for scrutinee")] + ElementInconsistentCaseScrutineeSet(Element), + #[display("Case analysis {_0} does not have consistent set for scrutinee")] - IncosistentCaseScrutineeSet(Element), + InstanceInconsistentCaseScrutineeSet(Instance), + #[display("Incomplete case analysis: covered [{}] but required [{}]", found.join(", "), required.join(", ") @@ -38,23 +47,32 @@ pub enum CheckerError { found: Vec, required: Vec, }, + #[display("Instance {value} claimed to belong to {claimed} but actually belongs to {real}")] WrongSignatureForInstance { value: InstanceValue, claimed: Signature, real: Signature, }, + #[display("Instance {instance} is not of signature {claimed}: {reason}")] InstanceDoesNotBelong { instance: Instance, claimed: Signature, reason: String, }, + #[display("Non-functional instance {instance} found in application to elements {}", elements.iter().map(|e| e.to_string()).collect::>().join(" "))] NonFunctionalInstance { instance: Instance, elements: Vec, }, + + #[display("Instance {instance} applied to too many arguments: {applied_to}")] + OverApplication { + instance: Instance, + applied_to: usize, + }, } // ----------------------------------------------------------------------------- -- cgit v1.3.1