From 9fe981fc6c5e5ef38fc9a425ccc1c875965717e6 Mon Sep 17 00:00:00 2001 From: Mark Date: Tue, 16 Jan 2024 12:00:16 +0100 Subject: [PATCH] fix bug where subtypes of list didn't include type of empty list --- mers/Cargo.toml | 4 ++-- mers_lib/Cargo.toml | 2 +- mers_lib/src/program/configs/with_list.rs | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/mers/Cargo.toml b/mers/Cargo.toml index 6c86d46..c3ffb3d 100755 --- a/mers/Cargo.toml +++ b/mers/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mers" -version = "0.3.2" +version = "0.3.3" edition = "2021" license = "MIT OR Apache-2.0" description = "dynamically typed but type-checked programming language" @@ -11,6 +11,6 @@ repository = "https://github.com/Dummi26/mers" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -mers_lib = "0.3.2" +mers_lib = "0.3.3" # mers_lib = { path = "../mers_lib", features = ["parse"] } clap = { version = "4.3.19", features = ["derive"] } diff --git a/mers_lib/Cargo.toml b/mers_lib/Cargo.toml index 85c2906..06598d0 100755 --- a/mers_lib/Cargo.toml +++ b/mers_lib/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mers_lib" -version = "0.3.2" +version = "0.3.3" edition = "2021" license = "MIT OR Apache-2.0" description = "library to use the mers language in other projects" diff --git a/mers_lib/src/program/configs/with_list.rs b/mers_lib/src/program/configs/with_list.rs index 4f47cc2..a053691 100755 --- a/mers_lib/src/program/configs/with_list.rs +++ b/mers_lib/src/program/configs/with_list.rs @@ -299,6 +299,8 @@ impl MersType for ListT { for t in self.0.subtypes_type().types { acc.add(Arc::new(Self(Type::newm(vec![t])))); } + // The type of an empty list is a list where the items are `` + acc.add(Arc::new(Self(Type::empty()))); } fn as_any(&self) -> &dyn std::any::Any { self