temporary bugfix/patch

This commit is contained in:
Mark 2024-04-16 14:27:02 +02:00
parent 2742112b09
commit a377c6e89a
3 changed files with 13 additions and 6 deletions

View File

@ -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"

View File

@ -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"

View File

@ -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