Skip to content
Merged
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
6 changes: 4 additions & 2 deletions compiler/noirc_frontend/src/hir/def_map/aztec_library.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,9 @@ fn create_context(ty: &str, params: &[(Pattern, UnresolvedType, Visibility)]) ->
UnresolvedTypeData::FieldElement => add_field_to_hasher(identifier),
// Add the integer to the hasher, casted to a field
// `hasher.add({ident} as Field)`
UnresolvedTypeData::Integer(..) => add_int_to_hasher(identifier),
UnresolvedTypeData::Integer(..) | UnresolvedTypeData::Bool => {
add_cast_to_hasher(identifier)
}
_ => unreachable!("[Aztec Noir] Provided parameter type is not supported"),
};
injected_expressions.push(expression);
Expand Down Expand Up @@ -613,7 +615,7 @@ fn add_field_to_hasher(identifier: &Ident) -> Statement {
))
}

fn add_int_to_hasher(identifier: &Ident) -> Statement {
fn add_cast_to_hasher(identifier: &Ident) -> Statement {
// `hasher.add({ident} as Field)`
// `{ident} as Field`
let cast_operation = cast(
Expand Down