Skip to content

Commit

Permalink
feat: imply the open keyword when using a public function
Browse files Browse the repository at this point in the history
  • Loading branch information
Maddiaa0 committed Aug 31, 2023
1 parent 6728015 commit a906655
Showing 1 changed file with 5 additions and 2 deletions.
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

0 comments on commit a906655

Please sign in to comment.