From a70dcaa949f41c585f9aea5e79f2550053d8e857 Mon Sep 17 00:00:00 2001 From: Joel Kronqvist Date: Tue, 19 Aug 2025 13:55:05 +0300 Subject: test: added boilerplate and tests for coproduct parsing, type checking and evaluation --- src/type/mod.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/type/mod.rs') diff --git a/src/type/mod.rs b/src/type/mod.rs index bfe0055..c726001 100644 --- a/src/type/mod.rs +++ b/src/type/mod.rs @@ -31,6 +31,8 @@ pub enum Type { VecOf(Box), VecType, // constructor + SumType(Box, Box), + LetType, /// Type for generics @@ -156,7 +158,8 @@ impl Type { LetType => Ok(()), NilType => Ok(()), TypeLit => Ok(()), - Arrow(a, b) => b.is_concrete().and_then(|_ok| a.is_concrete()), + Arrow(a, b) => b.is_concrete().and_then(|_ok| a.is_concrete()), + SumType(a, b) => b.is_concrete().and_then(|_ok| a.is_concrete()), List(v) => { let mut res = Ok(()); for t in v { -- cgit v1.2.3