aboutsummaryrefslogtreecommitdiff
path: root/src/checker_set.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/checker_set.rs')
-rw-r--r--src/checker_set.rs7
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(),