# occbin bug: varables with trend are not properly handled in switching equations

Assume a model with variables with trend:

```
var bg y (deflator=y0);
var t;
```

with parameters

```
parameters eta deftar
eta=0.01;
deftar=0.03;
```

I a variable with a trend appears in an equation that switches:

```
[name = 'debt stabilization rule', bind = 'bg0']
t=0;
[name = 'debt stabilization rule', relax = 'bg0']
t = eta*( (bg-bg(-1))/y - deftar);
...
```

```
steady_state_model;
t=0;
y=1;
bg=2.4;
end;
```

then, the switches are treated BEFORE handling the trends, which means that in static_resid the first difference `bg-bg(-1)`

is first evaluated to be ZERO (which is wrong, since the trend is not considered there), so that in steady state we have a residual equation like

`resid() = t_ss - eta*(-deftar);`

which provides a non-zero residual.

I fear a similar issue pops up in the dynamic file.