Because the compiler rewrites it to
```d
int val = __applyArg1;
uint key = __applyArg0;
```
when ref is not needed.  Otherwise const would not work either.  This already works for `opApply`, I just had to weaken the error condition.