diff --git a/core/prelude/i32.carbon b/core/prelude/i32.carbon index 6b3068e8bac0..365e5e310131 100644 --- a/core/prelude/i32.carbon +++ b/core/prelude/i32.carbon @@ -25,7 +25,7 @@ impl i32 as BitAnd { } impl i32 as BitAndAssign { fn Op[addr self: Self*](other: Self) { - *self = *self + other; + *self = *self & other; } } @@ -38,7 +38,7 @@ impl i32 as BitOr { } impl i32 as BitOrAssign { fn Op[addr self: Self*](other: Self) { - *self = *self + other; + *self = *self | other; } } diff --git a/examples/sieve.carbon b/examples/sieve.carbon index 18eba08ccdd5..921961f22daa 100644 --- a/examples/sieve.carbon +++ b/examples/sieve.carbon @@ -29,7 +29,7 @@ impl i32 as Core.BitAnd { } impl i32 as Core.BitAndAssign { fn Op[addr self: Self*](other: Self) { - *self = *self + other; + *self = *self & other; } } @@ -42,7 +42,7 @@ impl i32 as Core.BitOr { } impl i32 as Core.BitOrAssign { fn Op[addr self: Self*](other: Self) { - *self = *self + other; + *self = *self | other; } }