fix: (code gen): expect type now properly tracks constructor dependency.

This was specific to code gen generated functions.
This commit is contained in:
microproofs 2023-05-17 17:56:01 -04:00
parent 6b58d643de
commit 173154e406
2 changed files with 5 additions and 0 deletions

View File

@ -6,6 +6,8 @@
- **aiken-lang**: Fix for cases where identity function is used as a param to a - **aiken-lang**: Fix for cases where identity function is used as a param to a
function or assigned to a var. function or assigned to a var.
- **aiken-lang**: Fix for free unique caused by code gen function having a
missing dependency.
## v1.0.5-alpha - 2023-05-14 ## v1.0.5-alpha - 2023-05-14

View File

@ -2600,6 +2600,8 @@ impl<'a> CodeGenerator<'a> {
); );
} else if let Some(counter) = defined_data_types.get_mut(&data_type_name) { } else if let Some(counter) = defined_data_types.get_mut(&data_type_name) {
*counter += 1; *counter += 1;
} else {
defined_data_types.insert(data_type_name.clone(), 1);
} }
func_stack.var( func_stack.var(
@ -2792,6 +2794,7 @@ impl<'a> CodeGenerator<'a> {
*dep_scope = dep_scope.common_ancestor(&func_scope); *dep_scope = dep_scope.common_ancestor(&func_scope);
} }
dependency_map.insert(function.0, function.1); dependency_map.insert(function.0, function.1);
} }