From 169260b8c19733b48f53e85404089afc2850a077 Mon Sep 17 00:00:00 2001 From: Jeff Date: Wed, 20 Mar 2024 05:31:14 -0400 Subject: [PATCH] Begin README; Add type check for functions --- README.md | 5 +++++ dust-lang/src/abstract_tree/type.rs | 14 ++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/README.md b/README.md index e69de29..ae67285 100644 --- a/README.md +++ b/README.md @@ -0,0 +1,5 @@ +# Dust + +High-level programming language with effortless concurrency, automatic memory management, type +safety and advanced error handling. + diff --git a/dust-lang/src/abstract_tree/type.rs b/dust-lang/src/abstract_tree/type.rs index f0adb61..f5c24cd 100644 --- a/dust-lang/src/abstract_tree/type.rs +++ b/dust-lang/src/abstract_tree/type.rs @@ -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(());