Skip to content

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

3 participants