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: A function with ghost parameters used as a value is ghost #2847

Merged
merged 4 commits into from
Oct 11, 2022

Conversation

RustanLeino
Copy link
Collaborator

This PR fixes two issues: ghost parameters of function values and ghost parameters of arrow types.

  • Enforce that a non-ghost function with ghost parameters can be used as a value only in ghost contexts. For example, disallow var f := F; if f is compiled and F is a function with ghost parameters.
  • Disallow arrow types that look like they have ghost parameters. For example, disallow an attempted arrow type like (ghost int) -> int.

Fixes #2843

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

@RustanLeino RustanLeino marked this pull request as ready for review October 4, 2022 23:24
jtristan
jtristan previously approved these changes Oct 11, 2022
cpitclaudel
cpitclaudel previously approved these changes Oct 11, 2022
@RustanLeino RustanLeino dismissed stale reviews from cpitclaudel and jtristan via e5602b0 October 11, 2022 23:21
@RustanLeino RustanLeino enabled auto-merge (squash) October 11, 2022 23:21
@RustanLeino RustanLeino merged commit 7c207ae into dafny-lang:master Oct 11, 2022
@RustanLeino RustanLeino deleted the issue-2843 branch October 27, 2022 00:58
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.

Missing check of ghost parameters in arrow types
3 participants