printf debugs for problems with function typing
This commit is contained in:
parent
c8f961abbf
commit
f88d2331e3
@ -257,14 +257,17 @@ impl<'a> Infer<'a> {
|
|||||||
let mut arg_types: Vec<MonoType> = Vec::new();
|
let mut arg_types: Vec<MonoType> = Vec::new();
|
||||||
|
|
||||||
for (param_name, maybe_type) in params {
|
for (param_name, maybe_type) in params {
|
||||||
|
println!("HANDLING PARAM: {}", param_name);
|
||||||
let tau = local_infer.fresh();
|
let tau = local_infer.fresh();
|
||||||
let sigma = PolyType(HashSet::new(), tau);
|
let sigma = PolyType(HashSet::new(), tau);
|
||||||
local_infer.env.extend(param_name, sigma);
|
local_infer.env.extend(param_name, sigma);
|
||||||
}
|
}
|
||||||
|
|
||||||
let ret_type = local_infer.block(block)?;
|
let ret_type = local_infer.block(block)?;
|
||||||
|
println!("RET TYPE: {:?}", ret_type);
|
||||||
|
|
||||||
let mut final_type = MonoType::Function(Box::new(MonoType::Const(TypeConst::Unit)), Box::new(ret_type));
|
let mut final_type = MonoType::Function(Box::new(MonoType::Const(TypeConst::Unit)), Box::new(ret_type));
|
||||||
|
println!("ARG TYPES: {:?}", arg_types);
|
||||||
|
|
||||||
for ty in arg_types.into_iter().rev() {
|
for ty in arg_types.into_iter().rev() {
|
||||||
final_type = MonoType::Function(Box::new(ty), Box::new(final_type));
|
final_type = MonoType::Function(Box::new(ty), Box::new(final_type));
|
||||||
@ -308,6 +311,12 @@ impl<'a> Infer<'a> {
|
|||||||
let tau = self.instantiate(sigma);
|
let tau = self.instantiate(sigma);
|
||||||
tau
|
tau
|
||||||
},
|
},
|
||||||
|
Call { f, arguments } => {
|
||||||
|
/*
|
||||||
|
let sigma = match sel
|
||||||
|
*/
|
||||||
|
unimplemented!()
|
||||||
|
},
|
||||||
e => return Err(InferError::Custom(format!("this expression type not done yet: {:?}", e)))
|
e => return Err(InferError::Custom(format!("this expression type not done yet: {:?}", e)))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user