Skip to content

Remove automatic type detection when emitting a select #2074

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

Merged
merged 4 commits into from
Sep 13, 2021
Merged

Conversation

dcodeIO
Copy link
Member

@dcodeIO dcodeIO commented Sep 13, 2021

Fixes #2073 by removing error-prone automatic type detection when emitting a select expression. Was a legacy option anyway, from a time where selects didn't specify a type.

  • I've read the contributing guidelines
  • I've added my name and email to the NOTICE file

@dcodeIO dcodeIO changed the title Defuse select assertion on compile error Defuse select assertion after compile error Sep 13, 2021
@dcodeIO dcodeIO requested a review from MaxGraey September 13, 2021 14:51
@dcodeIO dcodeIO changed the title Defuse select assertion after compile error Remove automatic type detection when emitting a select Sep 13, 2021
@MaxGraey
Copy link
Member

You removed automatic type detection for select op. And that's what caused those problems?

@dcodeIO
Copy link
Member Author

dcodeIO commented Sep 13, 2021

Yes, the issue came from the attempt of automatic detection when one arm was of type unreachable, then not matching for both arms, like in the closure case where one of the variables is in another scope that currently yields a diagnostic. The fix now doesn't rely on this detection anymore, but instead the expected type is explicitly specified, in turn rendering the assertion unnecessary.

Copy link
Member

@MaxGraey MaxGraey left a comment

Choose a reason for hiding this comment

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

I see. LGTM

@dcodeIO dcodeIO merged commit 2d45564 into main Sep 13, 2021
@dcodeIO dcodeIO deleted the issue-2073 branch September 14, 2021 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Scoped access to closure caused to compiler crash
2 participants