With the `/warnShadowing` option, Dafny will issue a warning when a local variable shadows another variable (i.e., uses the same name). This is usually quite useful for avoiding the confusion that almost inevitably follows from such shadowing. However, there are occasionally places where it would be convenient to suppress such warnings. For example, when writing a function in an "iterative" style, you might want to write:
```
function P(x:int):int
function Q(x:int):int
function R(x:int):int
function Example(y:int) : int
{
var state := y;
var state := P(state);
var state := Q(state);
var state := R(state);
state
}
```
Obviously this could be rewritten as a series of function applications (e.g., `R(Q(P(y)))`) or by numbering the different state variables, but both may lead to something that's harder to read and understand. Thus, it would be nice if we could add an annotation, in this case, on the function Example, such as `{:warnShadowing false}`, or perhaps even more specific: `{:warnShadowing state false}`.
```
function P(x:int):int
function Q(x:int):int
function R(x:int):int
function Example(y:int) : int
{
var state := y;
var state := P(state);
var state := Q(state);
var state := R(state);
state
}
```
Obviously this could be rewritten as a series of function applications (e.g., `R(Q(P(y)))`) or by numbering the different state variables, but both may lead to something that's harder to read and understand. Thus, it would be nice if we could add an annotation, in this case, on the function Example, such as `{:warnShadowing false}`, or perhaps even more specific: `{:warnShadowing state false}`.