On Tue, 08 Apr 2014 17:05:09 -0400, Jeroen Bollen <jbin...@gmail.com>
wrote:
For some reason this code doesn't work...
module app;
void main() {
immutable char var = 'a';
immutable(char)* varPtr = &var;
test(&varPtr);
}
void test(immutable(char)** param) {
test2(param);
}
void test2(const(char)** test2) {
}
...
Is this a bug? I'm using DMD.
No, it's intended. If that was allowed, you could inadvertently overwrite
immutable data without a cast.
The rule of thumb is, 2 or more references deep does not implicitly
convert. One reference deep is OK.
-Steve