subclass instance construction

spir denis.spir at gmail.com
Fri Nov 5 02:54:11 PDT 2010


Hello,


I have a weird bug related to class instance construction. My guess is that it seems a superclass's this() is implicitely called (before the subclass's one, if any), even if overriden and without any use of "super". In my case, I have schematically:

=== super class ===
	this() {
	    doThis();
	}
=== sub class ===
	this() {
	    doFirst();
	    doThis();
	}

All happens as if doThis was performed _before_ doFirst... and performed again after doFirst! At least, that's what debug output shows, and it would correctly explain the bug. Strange. How should I express what I mean?


Denis
-- -- -- -- -- -- --
vit esse estrany ☣

spir.wikidot.com



More information about the Digitalmars-d-learn mailing list