Skip to content

Commit

Permalink
Merge 399bb7c into 806af24
Browse files Browse the repository at this point in the history
  • Loading branch information
jfecher authored Aug 26, 2024
2 parents 806af24 + 399bb7c commit 705ffc3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
6 changes: 3 additions & 3 deletions compiler/noirc_frontend/src/elaborator/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1041,9 +1041,6 @@ impl<'context> Elaborator<'context> {
// Matches on TypeVariable must be first so that we follow any type
// bindings.
(TypeVariable(int, _), other) | (other, TypeVariable(int, _)) => {
if let TypeBinding::Bound(binding) = &*int.borrow() {
return self.infix_operand_type_rules(binding, op, other, span);
}
if op.kind == BinaryOpKind::ShiftLeft || op.kind == BinaryOpKind::ShiftRight {
self.unify(
rhs_type,
Expand All @@ -1058,6 +1055,9 @@ impl<'context> Elaborator<'context> {
};
return Ok((lhs_type.clone(), use_impl));
}
if let TypeBinding::Bound(binding) = &*int.borrow() {
return self.infix_operand_type_rules(binding, op, other, span);
}
let use_impl = self.bind_type_variables_for_infix(lhs_type, op, rhs_type, span);
Ok((other.clone(), use_impl))
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[package]
name = "regression_5823"
type = "bin"
authors = [""]
compiler_version = ">=0.33.0"

[dependencies]
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
fn main() {
let x = 1 as u64;
let y = 2 as u8;
assert_eq(x << y, 4);
}

0 comments on commit 705ffc3

Please sign in to comment.