fix: incorrect index in TypeEqual for ConstraintType (#2754)

Just a typo.

Closes #2727
This commit is contained in:
Manmeet Singh
2023-04-10 13:17:33 -07:00
committed by GitHub
parent 31e907178f
commit 72d8f86e79
2 changed files with 20 additions and 1 deletions
+1 -1
View File
@@ -832,7 +832,7 @@ auto TypeEqual(Nonnull<const Value*> t1, Nonnull<const Value*> t2,
return false;
}
for (size_t j = 0; j < equality1.values.size(); ++j) {
if (!ValueEqual(equality1.values[i], equality2.values[i],
if (!ValueEqual(equality1.values[j], equality2.values[j],
equality_ctx)) {
return false;
}
@@ -0,0 +1,19 @@
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
// Exceptions. See /LICENSE for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
// AUTOUPDATE
// RUN: %{explorer-run}
// RUN: %{explorer-run-trace}
// CHECK:STDOUT: result: 0
package ExplorerTest api;
interface IFace {}
impl {.IFace : (type where type == i32 and type == i32 and type == i32, )} as IFace {
}
fn Main() -> i32 {
return 0;
}