DMD 2.057: import std.stdio; inout(int)** qux(inout(int) p, inout(int)** pp){ return pp; } void main(){ immutable(int) x; immutable(int)* y = &x; int z; *qux(1,&y)=&z; // BOOM. writeln(is(typeof(&z)==int*) && is(typeof( y)==immutable(int)*) && &z is y); // "true" } The code exploits the fact that inout matching does not check sanity, in order to perform the forbidden immutable(int)** => const(int)** conversion. The code could be slightly modified such that it performs an int** => const(int)** conversion instead. (Ideally, inout would be deduced as immutable in this specific example and the assignment would cause an error.)
This issue was recently fixed in 2.058head, by merging https://github.com/D-Programming-Language/dmd/pull/558 .