Skip to content

Remove some uses of ReturnTypeInfo#6577

Merged
geoffromer merged 2 commits intocarbon-language:trunkfrom
geoffromer:return-type-info
Jan 13, 2026
Merged

Remove some uses of ReturnTypeInfo#6577
geoffromer merged 2 commits intocarbon-language:trunkfrom
geoffromer:return-type-info

Conversation

@geoffromer
Copy link
Copy Markdown
Contributor

As with #6572, this is a step toward supporting function calls that have arbitrary numbers of initializing returns.

As with carbon-language#6572, this is a step toward supporting function calls that have
arbitrary numbers of initializing returns.
@geoffromer geoffromer requested a review from a team as a code owner January 10, 2026 02:12
@geoffromer geoffromer requested review from zygoloid and removed request for a team January 10, 2026 02:12
Comment thread toolchain/check/call.cpp Outdated
case SemIR::InitRepr::ByCopy:
case SemIR::InitRepr::Incomplete:
case SemIR::InitRepr::Abstract:
return_type_id = SemIR::ErrorInst::TypeId;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we assuming here that CheckFunctionReturnPatternType would have diagnosed in this case? I worry that that coupling is a bit fragile, and could lead to using an ErrorInst without ever having produced an error diagnostic; would it work to instead make that function return an error type when it diagnoses an error, and propagate that to return_type_id here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea. Done.

@geoffromer geoffromer enabled auto-merge January 13, 2026 01:07
@geoffromer geoffromer added this pull request to the merge queue Jan 13, 2026
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jan 13, 2026
@geoffromer geoffromer added this pull request to the merge queue Jan 13, 2026
Merged via the queue into carbon-language:trunk with commit 4a47f1e Jan 13, 2026
8 checks passed
@geoffromer geoffromer deleted the return-type-info branch January 13, 2026 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants