super constructors: I can't take it anymore!

Serg Kovrov kovrov at no.spam
Wed Aug 16 03:43:11 PDT 2006


Hello, everybody,

As subject says I am really on the edge. This implicitly generated 
parent constructor calls are... Evil.

Here is my near-real class hierarchy:
> class BaseWindow {
>   this() {
>     writefln("register BaseWindowClass");
>     writefln("create");
>   }
> }
> class FrameWindow : BaseWindow {
>   this(char[] caption) {
>     writefln("register FrameWindowClass");
>     writefln("create %s", caption);
>   }
> }
> class MyFrameWindow : FrameWindow {
> 	this(char[] caption) {
> 		super(caption);
> 	}
> }

When I create instance of MyFrameWindow, I've got:
> register BaseWindowClass
> create
> register FrameWindowClass
> create test

I think I understand why, but I'm completely unhappy with it =(

What I want is that the only constructor called were 
FrameWindow.this(char[]), to have *only* this:
> register FrameWindowClass
> create test


-- 
serg.



More information about the Digitalmars-d-learn mailing list