From a377c6e89adcc6686276f409cd6e2ddf3bc8acef Mon Sep 17 00:00:00 2001 From: Mark <> Date: Tue, 16 Apr 2024 14:27:02 +0200 Subject: [PATCH] temporary bugfix/patch --- mers/Cargo.toml | 4 ++-- mers_lib/Cargo.toml | 2 +- mers_lib/src/data/reference.rs | 13 ++++++++++--- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/mers/Cargo.toml b/mers/Cargo.toml index e427930..ff5e524 100644 --- a/mers/Cargo.toml +++ b/mers/Cargo.toml @@ -11,7 +11,7 @@ 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.8.1" -mers_lib = { path = "../mers_lib" } +mers_lib = "0.8.2" +# mers_lib = { path = "../mers_lib" } clap = { version = "4.3.19", features = ["derive"] } colored = "2.1.0" diff --git a/mers_lib/Cargo.toml b/mers_lib/Cargo.toml index 69cf8ff..634832a 100755 --- a/mers_lib/Cargo.toml +++ b/mers_lib/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mers_lib" -version = "0.8.1" +version = "0.8.2" edition = "2021" license = "MIT OR Apache-2.0" description = "library to use the mers language in other projects" diff --git a/mers_lib/src/data/reference.rs b/mers_lib/src/data/reference.rs index 4869c33..c69a36f 100755 --- a/mers_lib/src/data/reference.rs +++ b/mers_lib/src/data/reference.rs @@ -49,9 +49,16 @@ impl MersType for ReferenceT { self.is_same_type_as(target) } fn subtypes(&self, acc: &mut Type) { - // we don't call subtypes because (int/string) must stay that so we can assign either - // NOTE: this might not be right...? - acc.add(Arc::new(self.clone())); + // // we don't call subtypes because (int/string) must stay that so we can assign either + // // NOTE: this might not be right...? + // acc.add(Arc::new(self.clone())); + // FOR NOW (until we can put the compile-time type in ReferenceT), add all these types, too + // TODO: Figure out how to fix + // x := if true 1 else 0.5 + // &x.debug // prints &Int instead of &{Int/Float} at runtime :( + for t in self.0.subtypes_type().types { + acc.add(Arc::new(Self(Type::newm(vec![t])))); + } } fn as_any(&self) -> &dyn Any { self