Bug 3625 – Rebindable does not work with forward declarations
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
Other
OS
All
Creation time
2009-12-17T10:30:00Z
Last change time
2015-06-09T01:27:02Z
Keywords
rejects-valid
Assigned to
nobody
Creator
michel.fortin
Comments
Comment #0 by michel.fortin — 2009-12-17T10:30:13Z
import std.typecons;
class A {
Rebindable!(const B) r;
}
class B {
Rebindable!(const A) r;
}
Changing the template condition of Rebindable to use is(T == class) instead of is(T : Object) fixes things.
Comment #1 by smjg — 2009-12-20T15:03:28Z
You forgot to post the error messages.
----------
bz3625.d(4): Error: template instance Rebindable!(const(B)) does not match templ
ate declaration Rebindable(T) if (is(T : Object) || isArray!(T))
bz3625.d(4): Error: Rebindable!(const(B)) is used as a type
bz3625.d(4): Error: variable bz3625.A.r voids have no value
----------
(DMD 2.036 Windows)
Moreover, are you sure this is a Phobos bug and not a compiler bug?
Comment #2 by dsimcha — 2010-08-15T08:27:31Z
This one got fixed due to some forward referencing bugs getting fixed on the last release.