some type and expect fixes

This commit is contained in:
microproofs 2023-07-26 18:41:57 -04:00 committed by Kasey
parent 3545bad3c4
commit dcb3a9b45b
2 changed files with 7 additions and 21 deletions

View File

@ -737,7 +737,7 @@ impl<'a> CodeGenerator<'a> {
Pattern::Assign { name, .. } => name.to_string(), Pattern::Assign { name, .. } => name.to_string(),
Pattern::Discard { name, .. } => { Pattern::Discard { name, .. } => {
if props.full_check { if props.full_check {
format!("__discard_{}", name) format!("__discard_{}_{}", name, index)
} else { } else {
"_".to_string() "_".to_string()
} }
@ -779,7 +779,7 @@ impl<'a> CodeGenerator<'a> {
&& props.value_type.is_data() && props.value_type.is_data()
&& !tipo.is_data() && !tipo.is_data()
{ {
format!("__discard_{}", name) format!("__discard_{}_tail", name)
} else { } else {
"_".to_string() "_".to_string()
} }
@ -827,6 +827,7 @@ impl<'a> CodeGenerator<'a> {
arguments, arguments,
constructor, constructor,
name, name,
tipo: constr_tipo,
.. ..
} => { } => {
let mut sequence = vec![]; let mut sequence = vec![];
@ -882,7 +883,7 @@ impl<'a> CodeGenerator<'a> {
let mut type_map: IndexMap<usize, Arc<Type>> = IndexMap::new(); let mut type_map: IndexMap<usize, Arc<Type>> = IndexMap::new();
for (index, arg) in tipo.arg_types().unwrap().iter().enumerate() { for (index, arg) in constr_tipo.arg_types().unwrap().iter().enumerate() {
let field_type = arg.clone(); let field_type = arg.clone();
type_map.insert(index, field_type); type_map.insert(index, field_type);
} }
@ -904,7 +905,7 @@ impl<'a> CodeGenerator<'a> {
Pattern::Assign { name, .. } => name.to_string(), Pattern::Assign { name, .. } => name.to_string(),
Pattern::Discard { name, .. } => { Pattern::Discard { name, .. } => {
if props.full_check { if props.full_check {
format!("__discard_{}", name) format!("__discard_{}_{}", name, index)
} else { } else {
"_".to_string() "_".to_string()
} }
@ -935,7 +936,7 @@ impl<'a> CodeGenerator<'a> {
val, val,
arg_type, arg_type,
AssignmentProperties { AssignmentProperties {
value_type: props.value_type.clone(), value_type: arg_type.clone(),
kind: props.kind, kind: props.kind,
remove_unused: true, remove_unused: true,
full_check: props.full_check, full_check: props.full_check,
@ -985,7 +986,7 @@ impl<'a> CodeGenerator<'a> {
Pattern::Assign { name, .. } => name.to_string(), Pattern::Assign { name, .. } => name.to_string(),
Pattern::Discard { name, .. } => { Pattern::Discard { name, .. } => {
if props.full_check { if props.full_check {
format!("__discard_{}", name) format!("__discard_{}_{}", name, index)
} else { } else {
"_".to_string() "_".to_string()
} }

View File

@ -834,21 +834,6 @@ impl AirTree {
), ),
void(), void(),
vec![ vec![
AirTree::var(
ValueConstructor::public(
void(),
ValueConstructorVariant::ModuleFn {
name: EXPECT_ON_LIST.to_string(),
field_map: None,
module: "".to_string(),
arity: 1,
location: Span::empty(),
builtin: None,
},
),
EXPECT_ON_LIST,
"",
),
AirTree::builtin( AirTree::builtin(
DefaultFunction::TailList, DefaultFunction::TailList,
list(data()), list(data()),