-
Notifications
You must be signed in to change notification settings - Fork 254
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
Function values generate malformed Java #3892
Labels
kind: bug
Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label
lang: java
Dafny's Java transpiler and its runtime
Comments
RustanLeino
added a commit
to RustanLeino/dafny
that referenced
this issue
Apr 21, 2023
Similar but slightly different errors if you try to provide a witness (and tweak the subset type to make a witness possible), which #3893 doesn't yet fix: datatype Option<T> = Some(t: T) | None
type Fn<R> = f: int -> Option<R> | true witness PartialFnWitness
function PartialFnWitness<R>(x: int): Option<R> {
None
}
|
Thanks. I updated #3893 to fix this case, too. |
RustanLeino
added a commit
that referenced
this issue
May 4, 2023
This PR fixes several issues (resolution, verification, and compilation to C#, Java, and Go) related to when a subset type is defined by one of its type parameters. Fixes #3883 Fixes #3891 Fixes #3892 <small>By submitting this pull request, I confirm that my contribution is made under the terms of the [MIT license](https://github.com/dafny-lang/dafny/blob/master/LICENSE.txt).</small>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
kind: bug
Crashes, unsoundness, incorrect output, etc. If possible, add a `part:` label
lang: java
Dafny's Java transpiler and its runtime
Dafny version
4.0.0
Code to produce this issue
Command to run and resulting output
What happened?
Evidently, Java's type inference is not good enough to figure out the desired types. Some casts in the generated code are needed.
What type of operating system are you experiencing the problem on?
Mac
The text was updated successfully, but these errors were encountered: