Skip to content

Commit

Permalink
Fix contract test
Browse files Browse the repository at this point in the history
  • Loading branch information
jfecher committed Mar 28, 2023
1 parent 6ebd7fb commit ea94548
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions crates/nargo/tests/test_data/contracts/src/main.nr
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ fn main(x : Field, y : pub Field) {
}

contract Foo {
fn double(x: Field) -> Field { x * 2 }
fn triple(x: Field) -> Field { x * 3 }
fn double(x: Field) -> pub Field { x * 2 }
fn triple(x: Field) -> pub Field { x * 3 }
}
4 changes: 2 additions & 2 deletions crates/noirc_frontend/src/hir/resolution/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ impl From<ResolverError> for Diagnostic {
ident.0.span(),
);

diag.add_note("The `pub` keyword only has effects on arguments to the main function of a program. Thus, adding it to other function parameters can be deceiving and should be removed".to_owned());
diag.add_note("The `pub` keyword only has effects on arguments to the entry-point function of a program. Thus, adding it to other function parameters can be deceiving and should be removed".to_owned());
diag
}
ResolverError::NecessaryPub { ident } => {
Expand All @@ -178,7 +178,7 @@ impl From<ResolverError> for Diagnostic {
ident.0.span(),
);

diag.add_note("The `pub` keyword is mandatory for the main function return type because the verifier cannot retrieve private witness and thus the function will not be able to return a 'priv' value".to_owned());
diag.add_note("The `pub` keyword is mandatory for the entry-point function return type because the verifier cannot retrieve private witness and thus the function will not be able to return a 'priv' value".to_owned());
diag
}
ResolverError::ExpectedComptimeVariable { name, span } => Diagnostic::simple_error(
Expand Down

0 comments on commit ea94548

Please sign in to comment.