Skip to content

Commit

Permalink
wip debugging failures, use is_bool in noirc_driver
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeljklein committed Jan 9, 2025
1 parent cdd2343 commit 5972603
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion compiler/noirc_driver/src/abi_gen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ pub(super) fn abi_type_from_hir_type(context: &Context, typ: &Type) -> AbiType {
Type::Integer(sign, bit_width) => {
if bit_width.is_zero() {
unreachable!("{typ} cannot be used in the abi")
} else if bit_width.is_one() {
} else if bit_width.is_bool() {
return AbiType::Boolean;
} else if bit_width.is_field_element_bits() {
return AbiType::Field;
Expand Down
2 changes: 1 addition & 1 deletion compiler/noirc_frontend/src/elaborator/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,7 @@ impl<'context> Elaborator<'context> {
}

// TODO cleanup
dbg!("check_cast", &from, &to);
// dbg!("check_cast", &from, &to);

match to {
Type::Integer(sign, bits) => Type::Integer(*sign, *bits),
Expand Down
8 changes: 4 additions & 4 deletions compiler/noirc_frontend/src/hir_def/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1458,7 +1458,7 @@ impl Type {
Type::Integer(_, num_bits) => {

// TODO cleanup
dbg!("try_bind_to_polymorphic_int", self.kind(), &this, only_integer);
// dbg!("try_bind_to_polymorphic_int", self.kind(), &this, only_integer);

if num_bits.is_field_element_bits() {
if only_integer {
Expand Down Expand Up @@ -1626,7 +1626,7 @@ impl Type {
let only_integer = typ.is_integer();

// TODO cleanup
dbg!("try_bind_to_polymorphic_int: bound", &other, &var, only_integer);
// dbg!("try_bind_to_polymorphic_int: bound", &other, &var, only_integer);

other.try_bind_to_polymorphic_int(var, bindings, only_integer)
})
Expand All @@ -1641,7 +1641,7 @@ impl Type {
let only_integer = false;

// TODO cleanup
dbg!("try_bind_to_polymorphic_int: unbound int-or-field", &other, &var, only_integer);
// dbg!("try_bind_to_polymorphic_int: unbound int-or-field", &other, &var, only_integer);

other.try_bind_to_polymorphic_int(var, bindings, only_integer)
}),
Expand All @@ -1650,7 +1650,7 @@ impl Type {
let only_integer = true;

// TODO cleanup
dbg!("try_bind_to_polymorphic_int: unbound int", &other, &var, only_integer);
// dbg!("try_bind_to_polymorphic_int: unbound int", &other, &var, only_integer);

other.try_bind_to_polymorphic_int(var, bindings, only_integer)
})
Expand Down

0 comments on commit 5972603

Please sign in to comment.