1
0

Begin README; Add type check for functions

This commit is contained in:
Jeff 2024-03-20 05:31:14 -04:00
parent 9b74023ade
commit 169260b8c1
2 changed files with 19 additions and 0 deletions

View File

@ -0,0 +1,5 @@
# Dust
High-level programming language with effortless concurrency, automatic memory management, type
safety and advanced error handling.

View File

@ -75,6 +75,20 @@ impl Type {
return Ok(());
}
(
Type::Function {
parameter_types: left_parameters,
return_type: left_return,
},
Type::Function {
parameter_types: right_parameters,
return_type: right_return,
},
) => {
if left_return == right_return && left_parameters == right_parameters {
return Ok(());
}
}
(Type::Named(left), Type::Named(right)) => {
if left == right {
return Ok(());