mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-03 22:02:51 +01:00
Add Abstract enumerator to InitRepr::Kind (#6513)
This fixes a bug where `CheckFunctionReturnType` could sometimes fail to diagnose an abstract return type.
This commit is contained in:
@@ -100,7 +100,8 @@ auto CheckFunctionReturnType(Context& context, SemIR::LocId loc_id,
|
||||
|
||||
// If we couldn't determine the return information due to the return type
|
||||
// being incomplete, try to complete it now.
|
||||
if (return_info.init_repr.kind == SemIR::InitRepr::Incomplete) {
|
||||
if (return_info.init_repr.kind == SemIR::InitRepr::Incomplete ||
|
||||
return_info.init_repr.kind == SemIR::InitRepr::Abstract) {
|
||||
auto diagnose_incomplete_return_type = [&] {
|
||||
CARBON_DIAGNOSTIC(IncompleteTypeInFunctionReturnType, Error,
|
||||
"function returns incomplete type {0}", SemIR::TypeId);
|
||||
|
||||
Reference in New Issue
Block a user