problem with inheritance of FilterStream

bayo bayo.fr at gmail.com
Sun Dec 30 08:52:41 PST 2007


Hello.

Iv got a problem today i never seen befor. Maybe its the first time i
inherite a phobos class, i realy dont know.

When i create instance of Foo, the printf (maybe) generate an
"Error: Access Violation". If i remove all printf of the class (my real 
class is not this simple example) it run (but its hard to debug).

To "patch" this problem i remove the FilterStream inheritance, but i
use the same interface (without a real interface). I can do it for the
moment, but its not fine at all.

I have this problem with dmd 1.013 (win), i update to 1.015 and
its the same. I compile with -unittest, i test without this option,
and it change nothing.

I spend long time to understand the problem, is anybody see it?


import std.stream;

class Foo : FilterStream {
	this (Stream stream) {
		printf("foo\n"); // Error: Access Violation
		super(stream);
	}
}

class Foo2 {
	Stream source;
	this (Stream stream) {
		printf("foo2\n"); // No problem
		source = stream;
	}
}

unittest {
	printf("begin\n");
	new Foo(null);
	printf("end\n");
}

Thanks a lot for your help.
--bayo


More information about the Digitalmars-d-bugs mailing list