diff --git a/explorer/ast/value.cpp b/explorer/ast/value.cpp index 0172977c4b82..f3305c9eb7b3 100644 --- a/explorer/ast/value.cpp +++ b/explorer/ast/value.cpp @@ -832,7 +832,7 @@ auto TypeEqual(Nonnull t1, Nonnull 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; } diff --git a/explorer/testdata/constraint/where_multiple_equality.carbon b/explorer/testdata/constraint/where_multiple_equality.carbon new file mode 100644 index 000000000000..1619f6c68657 --- /dev/null +++ b/explorer/testdata/constraint/where_multiple_equality.carbon @@ -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; +}