diff options
| author | tslil <tslil@posteo.de> | 2026-05-05 11:15:07 +0100 |
|---|---|---|
| committer | tslil <tslil@posteo.de> | 2026-05-05 14:49:59 +0100 |
| commit | 89304b27ea81270684810c18d3315c9d399beaf9 (patch) | |
| tree | dbdf3ef92a09dec4b1434553355df8b99d9affbe /src/checker_set.rs | |
| parent | 1c47d2c4e0e9bd8ff38a7ef4939b78ac4722092b (diff) | |
address remaining TODO, fix issues with left-nesting for for and ext, add motivation blurb to the readme
Diffstat (limited to 'src/checker_set.rs')
| -rw-r--r-- | src/checker_set.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/checker_set.rs b/src/checker_set.rs index 98e10ec..a00ea81 100644 --- a/src/checker_set.rs +++ b/src/checker_set.rs @@ -1,7 +1,7 @@ use crate::ast::*; use crate::checker_state::*; -use std::collections::HashMap; +use std::collections::{HashMap, HashSet}; use tracing::instrument; impl CheckerState { @@ -11,6 +11,10 @@ impl CheckerState { Set::BuiltIn(_) => Ok(set.clone()), Set::Record(fields) => { let mut ctx = self.clone(); + let field_set = fields.iter().map(|f| &f.name).collect::<HashSet<&String>>(); + if field_set.len() != fields.len() { + todo!("duplicate fields"); + } let fields = fields .into_iter() .map(|Field { name, carries }| { @@ -260,7 +264,6 @@ impl CheckerState { }) } Element::Case { arms, scrutinee } => { - // TODO: do we allow mapping out of bottom? if arms.is_empty() { return Err(CheckerError::Unimplemented( "mapping out of bottom types".to_string(), |
