teaches arithmetic interfaces about C++ operators (#7123)

This commit is contained in:
Christopher Di Bella authored and GitHub committed 2026-04-28 01:00:21 +00:00
1 parent aa8f9d8c00
commit 9480c10ecf
11 files changed
+4160 -45

No files matched your search

+4
View File
@@ -250,6 +250,10 @@ auto CheckFunctionReturnTypeMatches(Context& context,
}
if (!context.types().AreEqualAcrossDeclarations(new_return_type_id,
prev_return_type_id)) {
if (new_function.name_id == SemIR::NameId::CppOperator &&
!prev_return_type_id.has_value()) {
return true;
}
if (!diagnose) {
return false;
}