You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
method Find(a: array<int>, key: int) returns (index: int)
requires a != null
ensures 0 <= index ==> index < a.Length && a[index] == key
{
// Can you write code that satisfies the postcondition?
// Hint: you can do it with one statement.
}
Dafny complains that array<int> is non-nullable. The error message suggests replacing it with array?<int> instead, which works.
The rest of the code samples in that section also need to be updated in the same way.
The text was updated successfully, but these errors were encountered:
In the
Arrays
section of the tutorial (https://rise4fun.com/Dafny/tutorial/Guide), the first code sample with theFind
method reads:Dafny complains that
array<int>
is non-nullable. The error message suggests replacing it witharray?<int>
instead, which works.The rest of the code samples in that section also need to be updated in the same way.
The text was updated successfully, but these errors were encountered: