Skip to content

Cache Match Alias applications and reductions, and ErrorType #17962

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

Closed
wants to merge 2 commits into from

Conversation

dwijnand
Copy link
Member

  • ErrorType instead of throwing in match type "no cases"
  • Cache applied match alias reductions

@dwijnand dwijnand changed the title Refactor Match Type reductions Cache Match Alias applications and reductions, and ErrorType Jun 12, 2023
dwijnand added 2 commits June 13, 2023 13:35
Instead of throwing MatchTypeReductionError, return
ErrorType(MatchTypeNoCases), which is a proper message as well.

This avoids having to catch and ignore it as an exception.  But it does
require discovering it from type simplification and reporting it then -
which replaces its reliance on catching TypeErrors.

It also required handling scrutinees that are error types, which
previously would always match the first case, due to FlexType semantics.
@dwijnand dwijnand force-pushed the mt/refactor-reduction branch from 6dd94d0 to dcc4d35 Compare June 13, 2023 12:35
@dwijnand dwijnand self-assigned this Jun 19, 2023
@dwijnand
Copy link
Member Author

Haven't found definitive proof that caching is necessary, with other issues being fixed in other ways, so only keeping the first half in #18016.

@dwijnand dwijnand closed this Jun 20, 2023
@dwijnand dwijnand deleted the mt/refactor-reduction branch June 20, 2023 13:29
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.

1 participant