Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a location for monomorphization failures resulting from TryToCompleteType. #4670

Merged
merged 4 commits into from
Dec 12, 2024

Conversation

zygoloid
Copy link
Contributor

@zygoloid zygoloid commented Dec 11, 2024

Almost all callers actually could never fail and nearly all of those already CHECK-failed on failure. Add a new overload for that case, and add a location parameter for the one remaining call.

Replace all callers but one with a new function to complete a type or
CHECK-fail.
return TypeCompleter(*this, loc, nullptr).Complete(type_id);
}

auto Context::CompleteTypeOrCheckFail(SemIR::TypeId type_id) -> void {
// TODO: We need a location here in case we need to instantiate a class type.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this TODO still relevant?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Huh, I thought I deleted that. Removed now. Thanks!

@zygoloid zygoloid enabled auto-merge December 12, 2024 00:33
@zygoloid zygoloid added this pull request to the merge queue Dec 12, 2024
Merged via the queue into carbon-language:trunk with commit 79ba184 Dec 12, 2024
8 checks passed
@zygoloid zygoloid deleted the toolchain-complete-type-loc branch December 12, 2024 01:00
bricknerb pushed a commit to bricknerb/carbon-lang that referenced this pull request Dec 16, 2024
…oCompleteType`. (carbon-language#4670)

Almost all callers actually could never fail and nearly all of those
already `CHECK`-failed on failure. Add a new overload for that case, and
add a location parameter for the one remaining call.
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