2011/12/13 Steven Schveighoffer <[email protected]>: > immutable(int) c; > auto pc = &c; > > foo(&pc, &b); > > Now, foo is being called with (immutable(int)**, int *). Inout resolves to > const (due to the mix of mutable and immutable). *NOW* we try calling foo > as if it were written: > > const(int)* foo(const(int)** a, const(int)* b); > > And it *FAILS*. This is because you cannot implicitly convert > immutable(int)** to const(int)** (well, at least it *shouldn't* compile, I'm > not sure if it does currently).
Today, with git head, this code might be rejected correctly. So relaxing inout rule is more reasonable now. Kenji Hara
