call might violate context's modifies clause #2164
-
Hi All, I have a question and hope to get help. Thanks.
After compiling and running the above code, it shows
It shows |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You can resolve your issue by assigning a value to
I guess you should view this as: you cannot call a method that modifies an unassigned value. I think your original program would crash if executed because it writes to an unassigned array. I will create an issue in Dafny because I do find that the error message is not clear about what the problem is. (#2171) |
Beta Was this translation helpful? Give feedback.
You can resolve your issue by assigning a value to
a
before passing it totest
, like so:I guess you should view this as: you cannot call a method that modifies an unassigned value. I think your original program would crash if executed because it writes to an unassigned array. I will create an issue in Dafny because I do find that the error message is not clear about what the problem is. (#2171)