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

Some ability checking adjustments #3149

Merged
merged 2 commits into from Jun 24, 2022
Merged

Some ability checking adjustments #3149

merged 2 commits into from Jun 24, 2022

Conversation

dolio
Copy link
Contributor

@dolio dolio commented Jun 24, 2022

Fixed an erroneous case when equating two sets of abilities. Normally we try to unify pieces of them with pieces of the opposite side to render them equal. However, in certain cases where that wasn't possible, we would just not do anything, and also not fail. This code tries some additional unification cases, and properly throws an error if nothing will work.

This caused some knock-on problems with certain test examples. For instance, if you annotate a handler as Request {...} r -> ..., then variables made up in the function body will fail to unify with the rigidly defined row. So ability checking for cases has been modified to avoid making up superfluous variables.

Fixes #3037 and #2848

- Fixed an erroneous case when equating two sets of abilities. Normally
  we try to unify pieces of them with pieces of the opposite side to
  render them equal. However, in certain cases where that wasn't
  possible, we would just not do anything, and also not fail. This code
  tries some additional unification cases, and properly throws an error
  if nothing will work.
- This caused some knock-on problems with certain test examples. For
  instance, if you annotate a handler as `Request {...} r -> ...`, then
  variables made up in the function body will fail to unify with the
  rigidly defined row. So ability checking for cases has been modified
  to avoid making up superfluous variables.
@pchiusano
Copy link
Member

Nice!

@pchiusano pchiusano merged commit e3e48c9 into trunk Jun 24, 2022
@pchiusano pchiusano deleted the fix/3037 branch June 24, 2022 01:57
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.

type-checking false positive with effect type
2 participants