mirror of
https://github.com/Dummi26/mers.git
synced 2025-12-14 11:16:17 +01:00
bugfix for builtin functions using 3-tuples
This commit is contained in:
@@ -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)
|
||||
))),
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user