bugfix for builtin functions using 3-tuples

This commit is contained in:
Mark
2024-10-11 23:42:14 +02:00
parent 786d72660f
commit d83f6f942f
4 changed files with 12 additions and 9 deletions

View File

@@ -1,4 +1,4 @@
use std::{marker::PhantomData, sync::Arc};
use std::marker::PhantomData;
use crate::{
data::{self, Data, MersData, Type},
@@ -59,10 +59,13 @@ pub trait StaticMersFunc: Sized + 'static + Send + Sync {
None => Err(CheckError::from(format!(
"unexpected argument of type {}, expected {}",
a.get().as_type().with_info(i),
Type::new(data::function::FunctionT(
Err(Arc::new(Self::types())),
crate::info::Info::neverused()
))
{
let mut o = Type::empty();
for t in Self::types() {
o.add_all(&t.0);
}
o
}
.with_info(i)
))),
}

View File

@@ -288,7 +288,7 @@ impl<A: FromMersData, B: FromMersData, C: FromMersData> FromMersData for (A, B,
if let Some(v) = d
.as_any()
.downcast_ref::<data::tuple::Tuple>()
.filter(|v| v.0.len() == 2)
.filter(|v| v.0.len() == 3)
{
A::try_represent(v.0[0].get().as_ref(), |v1| {
if let Some(va) = v1 {