Maybe I'm missing the thing, but I'm not able to declare local ref variable even if simple workaround exists. Is this preferred design pattern?

```
int main()
{
        int a = 1;
//ref int b = a; // Error: variable `tst_ref.main.b` only parameters or `foreach` declarations can be `ref`
        ref int b() { return a; }
        b = 2;
        assert(a == 2);
        return 0;
}
```

Fanda

Reply via email to