changeset 1378:fdd3e661958c

[Issue 1005] dmd: tocsym.c:343: virtual Symbol* FuncDeclaration::toSymbol(): Assertion `0' failed. Frank Benoit <benoit@tionex.de> 2007-02-24 http://d.puremagic.com/issues/show_bug.cgi?id=1005
author thomask
date Wed, 28 Feb 2007 00:29:57 +0000
parents 7e2f2adc7849
children f4ba482f309c
files run/b/bug_tocsym_343_A.d run/b/bug_tocsym_343_B.d
diffstat 2 files changed, 78 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/run/b/bug_tocsym_343_A.d	Wed Feb 28 00:29:57 2007 +0000
@@ -0,0 +1,40 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	Frank Benoit <benoit@tionex.de>
+// @date@	2007-02-24
+// @uri@	http://d.puremagic.com/issues/show_bug.cgi?id=1005
+// @desc@	[Issue 1005] dmd: tocsym.c:343: virtual Symbol* FuncDeclaration::toSymbol(): Assertion `0' failed.
+
+module dstress.run.b.bug_tocsym_343_A;
+
+int status;
+
+class Base {
+	void bar(){
+		status--;
+	}
+}
+
+class Foo : Base {
+	alias Base.bar bar;
+
+	void bar(){
+		status++;
+	}
+}
+
+int main(){
+	Foo f = new Foo();
+	auto dg = &f.bar;
+
+	if(0 == status){
+		assert(0);
+	}
+	dg();
+	if(1 == status){
+		assert(0);
+	}
+	return 0;
+}	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/run/b/bug_tocsym_343_B.d	Wed Feb 28 00:29:57 2007 +0000
@@ -0,0 +1,38 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	Frank Benoit <benoit@tionex.de>
+// @date@	2007-02-24
+// @uri@	http://d.puremagic.com/issues/show_bug.cgi?id=1005
+// @desc@	[Issue 1005] dmd: tocsym.c:343: virtual Symbol* FuncDeclaration::toSymbol(): Assertion `0' failed.
+
+module dstress.run.b.bug_tocsym_343_B;
+
+int status;
+
+class Base {
+	void bar(){
+		status--;
+	}
+}
+
+class Foo : Base {
+	void bar(){
+		status++;
+	}
+}
+
+int main(){
+	Foo f = new Foo();
+	auto dg = &f.bar;
+
+	if(0 == status){
+		assert(0);
+	}
+	dg();
+	if(1 == status){
+		assert(0);
+	}
+	return 0;
+}