On Tuesday, 25 December 2012 at 02:43:52 UTC, r_m_r wrote:
On 12/25/2012 07:42 AM, r_m_r wrote:
assert(!__traits(compiles, b._bar));
sorry, i made a typo: it should be bar_ instead of _bar.
Interestingly, the below assertion fails at run time:
assert(!__traits(compiles, b.bar_));
but this won't compile (as expected):
assert(b.bar_ == 20); //main.d(15): Error: undefined identifier
'bar_'
regards,
r_m_r
i'm not D expert, but isn't the first statement(b.bar_) evaluated
to b.opCall(Foo.opCall)? so the first assert may be true in this
case