fix types (see prev. commit)

This commit is contained in:
Mark 2024-10-11 23:05:35 +02:00
parent 08999e646a
commit 203f701758
2 changed files with 14 additions and 2 deletions

View File

@ -1,6 +1,6 @@
[package]
name = "mers_lib"
version = "0.9.7"
version = "0.9.8"
edition = "2021"
license = "MIT OR Apache-2.0"
description = "library to use the mers language in other projects"

View File

@ -155,10 +155,22 @@ impl Config {
mut self,
name: String,
val: Arc<RwLock<Data>>,
val_type: crate::data::Type,
mut val_type: crate::data::Type,
) -> Self {
// give the correct DisplayInfo to functions' inner scopes.
{
for t in val_type.types.iter_mut() {
if let Some(mut f) = t
.as_any()
.downcast_ref::<data::function::FunctionT>()
.cloned()
{
f.1.global.object_fields = Arc::clone(&self.info_check.global.object_fields);
f.1.global.object_fields_rev =
Arc::clone(&self.info_check.global.object_fields_rev);
*t = Arc::new(f);
}
}
let data = val.write().unwrap();
let mut data = data.get_mut_unchecked();
if let Some(f) = data.mut_any().downcast_mut::<data::function::Function>() {