|
|
@@ -224,7 +224,7 @@ static auto LookupInterfaceWitness(Context& context,
|
|
|
static auto PerformImplLookup(
|
|
|
Context& context, SemIR::LocId loc_id, SemIR::ConstantId type_const_id,
|
|
|
SemIR::AssociatedEntityType assoc_type, SemIR::InstId member_id,
|
|
|
- std::optional<Context::BuildDiagnosticFn> missing_impl_diagnoser)
|
|
|
+ Context::BuildDiagnosticFn missing_impl_diagnoser = nullptr)
|
|
|
-> SemIR::InstId {
|
|
|
auto interface_type =
|
|
|
context.types().GetAs<SemIR::InterfaceType>(assoc_type.interface_type_id);
|
|
|
@@ -236,7 +236,7 @@ static auto PerformImplLookup(
|
|
|
CARBON_DIAGNOSTIC(MissingImplInMemberAccessNote, Note,
|
|
|
"type `{1}` does not implement interface `{0}`",
|
|
|
SemIR::NameId, SemIR::TypeId);
|
|
|
- (*missing_impl_diagnoser)()
|
|
|
+ missing_impl_diagnoser()
|
|
|
.Note(loc_id, MissingImplInMemberAccessNote, interface.name_id,
|
|
|
context.GetTypeIdForTypeConstant(type_const_id))
|
|
|
.Emit();
|
|
|
@@ -336,7 +336,7 @@ static auto LookupMemberNameInScope(Context& context, SemIR::LocId loc_id,
|
|
|
context.types().TryGetAs<SemIR::AssociatedEntityType>(type_id)) {
|
|
|
if (ScopeNeedsImplLookup(context, lookup_scope)) {
|
|
|
member_id = PerformImplLookup(context, loc_id, name_scope_const_id,
|
|
|
- *assoc_type, member_id, std::nullopt);
|
|
|
+ *assoc_type, member_id);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -494,8 +494,7 @@ auto PerformMemberAccess(Context& context, SemIR::LocId loc_id,
|
|
|
auto PerformCompoundMemberAccess(
|
|
|
Context& context, SemIR::LocId loc_id, SemIR::InstId base_id,
|
|
|
SemIR::InstId member_expr_id,
|
|
|
- std::optional<Context::BuildDiagnosticFn> missing_impl_diagnoser)
|
|
|
- -> SemIR::InstId {
|
|
|
+ Context::BuildDiagnosticFn missing_impl_diagnoser) -> SemIR::InstId {
|
|
|
// Materialize a temporary for the base expression if necessary.
|
|
|
base_id = ConvertToValueOrRefExpr(context, base_id);
|
|
|
auto base_type_id = context.insts().Get(base_id).type_id();
|