Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(aztec_noir): imply the open keyword #2508

Merged
merged 2 commits into from
Aug 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions crates/noirc_frontend/src/hir/def_map/aztec_library.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,11 @@ fn transform_function(ty: &str, func: &mut NoirFunction) {
func.def.return_visibility = Visibility::Public;

// Distinct return types are only required for private functions
if ty == "Private" {
func.def.return_distinctness = Distinctness::Distinct;
// Public functions should have open auto-inferred
match ty {
"Private" => func.def.return_distinctness = Distinctness::Distinct,
"Public" => func.def.is_open = true,
_ => (),
}
}

Expand Down
2 changes: 1 addition & 1 deletion crates/noirc_frontend/src/hir/def_map/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ impl CrateDefMap {
let ast = parse_file(&mut context.file_manager, root_file_id, errors);

#[cfg(feature = "aztec")]
let ast = aztec_library::transform(ast);
let ast = aztec_library::transform(ast, &crate_id, context, errors);
Maddiaa0 marked this conversation as resolved.
Show resolved Hide resolved

// Allocate a default Module for the root, giving it a ModuleId
let mut modules: Arena<ModuleData> = Arena::default();
Expand Down