www.digitalmars.com         C & C++   DMDScript  

D - bug? constructors from parent class

While it's good to have aliases for parent's methods, this can't be done
yet:

class A {
 int a;
 this(int x) {
  a=x;
 }
}

class B : A { }

void foo() {
 B b=new B(4);
}

"constructor this (int x) does not match argument types ()"

And if I try to alias (alias A.this this;), I get "identifier expected
following '.' instead of 'this'".

So when someone said something about writing:

class MyException : Exception { this(char [] name) { super(name); } }

this still continues.

-------------------------
Carlos Santander


---

Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.514 / Virus Database: 312 - Release Date: 2003-08-28
Aug 29 2003