Bug 3318 – [PATCH]Rebindable.get is not accessible
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2009-09-14T23:18:00Z
Last change time
2015-06-09T01:26:47Z
Assigned to
andrei
Creator
sludwig
Comments
Comment #0 by sludwig — 2009-09-14T23:18:24Z
Rebindable.get is an alias for Rebindable.original, which in turn is private:
---
import std.typecons;
class C {}
void main(){
Rebindable!(const(C)) test;
const(C) testCopy = test.get;
}
---
test.d(7): Error: struct std.typecons.Rebindable!(const(C)).Rebindable member original is not accessible
test.d(7): Error: struct std.typecons.Rebindable!(const(C)).Rebindable member original is not accessible
Comment #1 by simen.kjaras — 2010-08-31T07:55:51Z
This is the fix - replace this line(746 in 2.048) in std/typecons.d:
alias original get;
with this:
@property
ref T get( ) {
return original;
}
What's the point of
alias get this;
in the fix? I would have thought that that would conflict with the get property function. It would seem to make it so that get would either give you the type that Rebindable!() holds or Rebindable!() itself which would appear to effectively overload get on the return type.
Comment #4 by andrei — 2010-10-03T12:09:35Z
The alias makes Rebindable!T a near-subtype of T.
Comment #5 by schveiguy — 2010-10-04T06:15:59Z
*** Issue 4978 has been marked as a duplicate of this issue. ***