mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-04 22:02:52 +01:00
Switch more of toolchain to enumerate/seq (#3137)
These were already used in a few spots, just trying to switch more loops for consistency and ease of reading.
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
|
||||
#include "common/check.h"
|
||||
#include "common/vlog.h"
|
||||
#include "llvm/ADT/STLExtras.h"
|
||||
#include "toolchain/diagnostics/diagnostic_kind.h"
|
||||
#include "toolchain/lexer/tokenized_buffer.h"
|
||||
#include "toolchain/parser/parse_node_kind.h"
|
||||
@@ -298,9 +299,8 @@ auto SemanticsContext::ImplicitAsForArgs(
|
||||
// Check type conversions per-element.
|
||||
// TODO: arg_ir_id is passed so that implicit conversions can be inserted.
|
||||
// It's currently not supported, but will be needed.
|
||||
for (size_t i = 0; i < arg_refs.size(); ++i) {
|
||||
auto value_id = arg_refs[i];
|
||||
auto as_type_id = semantics_ir_->GetNode(param_refs[i]).type_id();
|
||||
for (auto [i, value_id, param_ref] : llvm::enumerate(arg_refs, param_refs)) {
|
||||
auto as_type_id = semantics_ir_->GetNode(param_ref).type_id();
|
||||
if (ImplicitAsImpl(value_id, as_type_id,
|
||||
diagnostic == nullptr ? &value_id : nullptr) ==
|
||||
ImplicitAsKind::Incompatible) {
|
||||
|
||||
Reference in New Issue
Block a user