Просмотр исходного кода

Fix copy-pasted operator impls from #3856 (#3862)

Co-authored-by: Josh L <josh11b@users.noreply.github.com>
josh11b 2 лет назад
Родитель
Сommit
4bd6f8d4be
2 измененных файлов с 4 добавлено и 4 удалено
  1. 2 2
      core/prelude/i32.carbon
  2. 2 2
      examples/sieve.carbon

+ 2 - 2
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;
   }
 }
 

+ 2 - 2
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;
   }
 }