fix get having wrong return type

This commit is contained in:
Mark 2023-10-27 17:17:27 +02:00
parent cb52c961a2
commit c652c618d2

View File

@ -1,7 +1,7 @@
use std::sync::{Arc, Mutex}; use std::sync::{Arc, Mutex};
use crate::{ use crate::{
data::{self, Data, MersType}, data::{self, Data, MersType, Type},
program::{self, run::CheckInfo}, program::{self, run::CheckInfo},
}; };
@ -15,9 +15,12 @@ impl Config {
Data::new(data::function::Function { Data::new(data::function::Function {
info: Arc::new(program::run::Info::neverused()), info: Arc::new(program::run::Info::neverused()),
info_check: Arc::new(Mutex::new(CheckInfo::neverused())), info_check: Arc::new(Mutex::new(CheckInfo::neverused())),
out: Arc::new(|a, i| { out: Arc::new(|a, _i| {
if let Some(v) = a.get() { if let Some(v) = a.get() {
Ok(v) Ok(Type::newm(vec![
Arc::new(data::tuple::TupleT(vec![v])),
Arc::new(data::tuple::TupleT(vec![])),
]))
} else { } else {
Err(format!("called get on non-gettable type {a}").into()) Err(format!("called get on non-gettable type {a}").into())
} }