When the following code is checked using the console version 1.9.1, in spite of the fact that the while loop should not be verified successfully, Dafny does not report any error.
class Bug {
The problem seems to be in assignment to the array list, when it is placed as a variable of the class. If you remove the assignment, or you defined list as a local variable, then Dafny reports the expected error related to the loop.
class Bug {
var list:array<int>;
method Foo()
modifies this`list;
{
list := new int[10];
var i:int := 0;
while (i < 10)
decreases i;
{
}
}
}The problem seems to be in assignment to the array list, when it is placed as a variable of the class. If you remove the assignment, or you defined list as a local variable, then Dafny reports the expected error related to the loop.