Bug 3629 – Immutable/shared disappear in circular module imports
Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2009-12-17T14:28:00Z
Last change time
2015-06-09T01:27:02Z
Assigned to
nobody
Creator
tomeksowi
Comments
Comment #0 by tomeksowi — 2009-12-17T14:28:24Z
Testcase (should pass):
----------------------------------------------
module hello;
import test;
struct Strukt {
Staly* s;
}
----------------------------------------------
module test;
import hello;
immutable struct Staly {
int a;
}
void f_strukt(Strukt* stk) {
f_staly(stk.s); // ups!
}
void f_staly(Staly* s) { }
----------------------------------------------
Error: function test.f_staly (immutable(Staly)* s) is not callable using argument types (Staly*)
Error: cannot implicitly convert expression ((*stk).s) of type Staly* to immutable(Staly)*
Same story if Staly is shared.
Comment #1 by andrej.mitrovich — 2013-01-26T19:00:07Z