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

Fix: Support for opaque function handles #4203

Merged

Conversation

MikaelMayer
Copy link
Member

This PR fixes #4202
I added the corresponding test.

By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.

@MikaelMayer MikaelMayer requested a review from atomb June 20, 2023 19:33
@MikaelMayer MikaelMayer enabled auto-merge (squash) June 21, 2023 14:52
Copy link
Member

@atomb atomb left a comment

Choose a reason for hiding this comment

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

This is great! I made one tiny suggested edit for the test.

@@ -5845,7 +5853,7 @@ void CheckCasePatternShape<VT>(CasePattern<VT> pat, Bpl.Expr rhs, IToken rhsTok,
}

{
// Requires(Ty.., F#Handle( Ty1, ..., TyN, Layer, self), Heap, arg1, ..., argN)
// Requires(Ty.., F#Handle( Ty1, ..., TyN, Layer, reveal, self), Heap, arg1, ..., argN)
Copy link
Member

Choose a reason for hiding this comment

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

Based on my initial experiments, this should make it easier to allow all functions to have a reveal parameter. The fact that requires didn't have this parameter was an awkward asymmetry.

Copy link
Member Author

Choose a reason for hiding this comment

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

To be fair, we add the reveal parameter to the handle version of the function, not its requires. Since requirements and postconditions are always revealed, there is no need for a reveal parameter in .reveal

Test/git-issues/git-issue-4202.dfy Show resolved Hide resolved
Co-authored-by: Aaron Tomb <aarotomb@amazon.com>
atomb
atomb previously approved these changes Jun 21, 2023
@MikaelMayer MikaelMayer merged commit 58b1b9b into master Jun 22, 2023
@MikaelMayer MikaelMayer deleted the fix-4202-opaque-functions-passed-as-arguments-causes-type branch June 22, 2023 15:11
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.

Opaque functions passed as arguments causes type checking errors
2 participants