diff options
author | Joel Kronqvist <joel.kronqvist@iki.fi> | 2025-08-02 17:53:09 +0300 |
---|---|---|
committer | Joel Kronqvist <joel.kronqvist@iki.fi> | 2025-08-02 17:53:09 +0300 |
commit | 9121a0b782d2cd6551a393f1d3a79c7b092e4873 (patch) | |
tree | dea5e6644131d76b4456296d30f60d9c846af919 /src/type/util.rs | |
parent | 0f9542109275de75641185d4d94dbe7c35a49088 (diff) | |
download | myslip-9121a0b782d2cd6551a393f1d3a79c7b092e4873.tar.gz myslip-9121a0b782d2cd6551a393f1d3a79c7b092e4873.zip |
Added tests for type_check. Implemented std::fmt::Display for many enums. Added type variants List(Type), and UndefinedType for use in error messages. Implemented type utility arr(a, b).
Diffstat (limited to 'src/type/util.rs')
-rw-r--r-- | src/type/util.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/type/util.rs b/src/type/util.rs new file mode 100644 index 0000000..27fc661 --- /dev/null +++ b/src/type/util.rs @@ -0,0 +1,7 @@ + +use crate::r#type::{*, Type::*}; + +pub fn arr(a: impl Into<Box<Type>>, b: impl Into<Box<Type>>) -> Type { + Arrow(a.into(), b.into()) +} + |