http://d.puremagic.com/issues/show_bug.cgi?id=4099
Summary: Inconsistent behaviour of ++/-- when mixing opUnary
and 'alias this'.
Product: D
Version: unspecified
Platform: x86
OS/Version: Windows
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: [email protected]
ReportedBy: [email protected]
--- Comment #0 from [email protected] 2010-04-17 05:13:08 PDT ---
In the following example, ++x calls opUnary while x++ is performed on x
directly:
struct X
{
int x;
alias x this;
typeof(this) opUnary (string operator) ()
{
writeln ("operator called");
return this;
}
}
unittest
{
X x;
++x; //operator called
auto y = x++; //BUG! (alias this used. returns int)
}
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------