Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions toolchain/check/handle_where.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ auto HandleParseNode(Context& context, Parse::WhereOperandId node_id) -> bool {
auto self_with_constraints_type_id =
ExprAsType(context, self_node, self_id).type_id;
// Only facet types may have `where` restrictions.
if (self_with_constraints_type_id != SemIR::ErrorInst::TypeId &&
!context.types().IsFacetType(self_with_constraints_type_id)) {
if (!context.types().IsFacetTypeOrError(self_with_constraints_type_id)) {
CARBON_DIAGNOSTIC(WhereOnNonFacetType, Error,
"left argument of `where` operator must be a facet type");
context.emitter().Emit(self_node, WhereOnNonFacetType);
Expand Down
3 changes: 1 addition & 2 deletions toolchain/sem_ir/type_iterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ class TypeIterator {
// The iterator will visit things in the reverse order that they are added.
auto Add(InstId inst_id) -> void {
auto type_id = sem_ir_->insts().Get(inst_id).type_id();
CARBON_CHECK(sem_ir_->types().IsFacetType(type_id) ||
type_id == SemIR::ErrorInst::TypeId,
CARBON_CHECK(sem_ir_->types().IsFacetTypeOrError(type_id),
"Type {0} of type inst is not a facet type",
sem_ir_->types().GetAsInst(type_id).kind());
PushInstId(inst_id);
Expand Down
Loading