diff options
| author | tslil <tslil@posteo.de> | 2026-04-27 10:13:10 +0100 |
|---|---|---|
| committer | tslil <tslil@posteo.de> | 2026-04-27 11:27:40 +0100 |
| commit | a3205cfa58fb3cf16757c65345dd99d27e73a42f (patch) | |
| tree | f2dab9ddbd4a48a668072d231139b71472d8b2f3 /src/checker.rs | |
| parent | 1b97296cb4e043ed6ba8e200bcfc36bd60e602a9 (diff) | |
add distinction between hypothetical and concrete elements to the set checker, it now enforces that all arms in case are well typed!
Diffstat (limited to 'src/checker.rs')
| -rw-r--r-- | src/checker.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/checker.rs b/src/checker.rs index 3ebcb4d..1760c0e 100644 --- a/src/checker.rs +++ b/src/checker.rs @@ -1,5 +1,5 @@ use crate::ast::*; -use crate::checker_state::{CheckerError, CheckerState}; +use crate::checker_state::{CheckerError, CheckerState, ElementValue}; use tracing::{debug, instrument}; @@ -25,7 +25,12 @@ impl CheckerState { Decl::Element { name, element, set } => { let set = self.check_set(set)?; - let element = self.check_element(element, &set)?; + let element = self.check_element(element.clone().into(), &set)?; + if matches!(element, ElementValue::Hypothetical(_)) { + panic!( + "invariant violation: from concrete values at the top level we returned a hypothetical value" + ); + } self.add_element(name.clone(), element, set) } Decl::Signature { .. } => { |
