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

This commit is contained in:
Christopher Di Bella
2026-04-28 01:00:21 +00:00
committed by GitHub
parent aa8f9d8c00
commit 9480c10ecf
11 changed files with 4160 additions and 45 deletions
+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;
}