We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Consider the following code:
method First(s: seq<int>) requires |s| != 0 returns (j: int) { return s[0] }
It will emit the equivalent of
fn First(s: Sequence<DafnyInt>) -> DafnyInt { s.get(int!(0)) }
which results in a conversion of 0 to DafnyInt and then back to a usize We could get rid of this conversion issue by emitting
0
DafnyInt
usize
s.get_usize(truncate!(int!(0), usize))
because in that case, the expression simplifier would just replace it with
s.get_usize(0)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Consider the following code:
It will emit the equivalent of
which results in a conversion of
0
toDafnyInt
and then back to ausize
We could get rid of this conversion issue by emitting
because in that case, the expression simplifier would just replace it with
The text was updated successfully, but these errors were encountered: