diff --git a/dust-lang/src/abstract_tree/type.rs b/dust-lang/src/abstract_tree/type.rs
index 3cd04ff..b110ce5 100644
--- a/dust-lang/src/abstract_tree/type.rs
+++ b/dust-lang/src/abstract_tree/type.rs
@@ -113,7 +113,18 @@ impl Type {
return_type: right_return,
},
) => {
- if left_return == right_return && left_parameters == right_parameters {
+ if left_return.node == right_return.node {
+ for (left_parameter, right_parameter) in
+ left_parameters.iter().zip(right_parameters.iter())
+ {
+ if left_parameter.node != right_parameter.node {
+ return Err(TypeConflict {
+ actual: other.clone(),
+ expected: self.clone(),
+ });
+ }
+ }
+
return Ok(());
}
}
diff --git a/dust-lang/src/lib.rs b/dust-lang/src/lib.rs
index f9cc274..08e1e3c 100644
--- a/dust-lang/src/lib.rs
+++ b/dust-lang/src/lib.rs
@@ -19,7 +19,8 @@ pub use value::Value;
pub fn interpret<'src>(source_id: &str, source: &str) -> Result