Summary: Assigning null to class with nested alias this class
                    is misinterpreted
           Product: D
           Version: D2
          Platform: Other
        OS/Version: FreeBSD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from 2011-09-08 16:04:03 PDT ---
version = Stage1;
version = Stage2;

class A {
  this() { b = new B(); }
  B b;
  alias b this;

class B {

void fun(A a)
  a = null;
  version (Stage1)
    assert(a is null);

void main() {
  auto a = new A;
  assert(a.b !is null);
  assert(a !is null);
  version (Stage2)
    assert(a.b !is null);


If you want to nullify an reference to a and assign null to it,
instead a's reference to b is nullified.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to