From 4bd6f8d4be66484aa69726a4e09ff073588c0376 Mon Sep 17 00:00:00 2001 From: josh11b <15258583+josh11b@users.noreply.github.com> Date: Thu, 4 Apr 2024 14:15:24 -0700 Subject: [PATCH] Fix copy-pasted operator impls from #3856 (#3862) Co-authored-by: Josh L --- core/prelude/i32.carbon | 4 ++-- examples/sieve.carbon | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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; } }