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

Cannot include opaque types in datatype definitions with higher-order functions #626

Open
danmatichuk opened this issue May 15, 2020 · 0 comments
Labels
kind: enhancement Enhancements, feature requests, etc. These are NOT bugs, but ways we can improve Dafny

Comments

@danmatichuk
Copy link
Collaborator

The following program fails the export consistency check:

module M1 {
  type T

  datatype D<U> = D(h : T -> int)
}

With the error message: formal type parameter 'T' is not used according to its variance specification (it is used left of an arrow) (perhaps try declaring 'T' as '!T')

This is, in general, a necessary check for soundness (although there is no way to declare T appropriately to make this valid), but in particular it makes it impossible to export this type as provides.

module M1 {
  export reveals D provides T

  type T = int

  datatype D<U> = D(h : T ~> int)
}
@acioc acioc added kind: enhancement Enhancements, feature requests, etc. These are NOT bugs, but ways we can improve Dafny and removed weakness labels Jun 22, 2020
@acioc acioc added this to the Dafny 3.0 milestone Jul 22, 2020
@davidcok davidcok modified the milestones: Dafny 3.0, Dafny 3.1 Dec 23, 2020
@atomb atomb removed this from the Dafny 3.1 milestone Apr 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: enhancement Enhancements, feature requests, etc. These are NOT bugs, but ways we can improve Dafny
Projects
None yet
Development

No branches or pull requests

4 participants