new static if bug Re: DMD 1.032 and 2.016 releases

user e at mail.com
Wed Jul 9 13:22:44 PDT 2008


New bug introduced in 2.016  (2.015, 2.013 are ok)

$ ../dmd-v2.016/bin/dmd -c staticif.d
staticif.d(27): Error: no property 'f' for type 'staticif.AA'
staticif.d(27): Error: function expected before (), not 1 of type int
staticif.d(28): Error: no property 'f' for type 'staticif.BB'
staticif.d(28): Error: function expected before (), not 1 of type int

$ cat staticif.d

class A {
}

class B {
}

template T(X) {
static if (is(typeof(X) : A) ||
           is(typeof(X) : B) ) {
void f() {
}
}

}

class AA {
  mixin T!(A);
}

class BB {
  mixin T!(B);
}

int main() {
  AA a = new AA();
  BB b = new BB();
  a.f();
  b.f();

  return 0;
}



More information about the Digitalmars-d-announce mailing list