Skip to content

Commit 7694d02

Browse files
committed
review
1 parent 644e073 commit 7694d02

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

toolchain/check/convert.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1225,9 +1225,6 @@ static auto PerformBuiltinConversion(
12251225
// form. We can skip past the whole impl lookup step then and do that
12261226
// here.
12271227
//
1228-
// See also test:
1229-
// facet_access_type_converts_back_to_original_facet_value.carbon
1230-
//
12311228
// TODO: This instruction is going to become a `SymbolicBindingType`, so
12321229
// we'll need to handle that instead.
12331230
auto const_type_inst_id =

toolchain/check/eval_inst.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -210,14 +210,12 @@ auto EvalConstantInst(Context& context, SemIR::FacetValue inst)
210210
if (auto access =
211211
context.insts().TryGetAs<SemIR::FacetAccessType>(inst.type_inst_id)) {
212212
auto bind_id = access->facet_value_inst_id;
213-
auto bind = context.insts().Get(bind_id);
214-
if (bind.Is<SemIR::BindSymbolicName>()) {
215-
// If the FacetTypes are the same, then the FacetValue didn't add/remove
216-
// any witnesses.
217-
if (bind.type_id() == inst.type_id) {
218-
return ConstantEvalResult::Existing(
219-
context.constant_values().Get(bind_id));
220-
}
213+
auto bind = context.insts().TryGetAs<SemIR::BindSymbolicName>(bind_id);
214+
// If the FacetTypes are the same, then the FacetValue didn't add/remove
215+
// any witnesses.
216+
if (bind.has_value() && bind->type_id == inst.type_id) {
217+
return ConstantEvalResult::Existing(
218+
context.constant_values().Get(bind_id));
221219
}
222220
}
223221

0 commit comments

Comments
 (0)