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) {
}
It'll give you " Error: function app.test2 (const(char)** test2)
is not callable using argument types (immutable(char)**)", which
makes no sense as if a function requests a constant variable,
immutable should suffice.
What's even weirder (although it is what should happen), if you
remove one of the pointers, it compiles fine.
module app;
void main() {
immutable char var = 'a';
test(&var);
}
void test(immutable(char)* param) {
test2(param);
}
void test2(const(char)* test2) {
}
Is this a bug? I'm using DMD.