http://d.puremagic.com/issues/show_bug.cgi?id=8446
Summary: Can't use 'this' pointer in pure member function?
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: [email protected]
ReportedBy: [email protected]
--- Comment #0 from Dmitry Olshansky <[email protected]> 2012-07-26
13:53:25 PDT ---
A test case, probably can be reduced futher:
@trusted public struct RleBitSet(T)
{
public:
@property auto byInterval() pure const
{
static struct IntervalRange
{
this(in RleBitSet set_)
{
}
}
return IntervalRange(this);
}
}
immutable set = RleBitSet!(uint).init;
pure void func()
{
auto x = set.byInterval;
}
Tested on DMD 2.060 beta. Compiler flags seem to have no effect.
Output:
bug.d(14): Error: pure function 'byInterval' cannot call impure function 'this'
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------