changeset 1299:38be9fe455e2

[Issue 619] Alias of templated struct instance crashes 0.175 Kirk McDonald <kirklin.mcdonald@gmail.com> 2006-11-29 http://d.puremagic.com/issues/show_bug.cgi?id=619
author thomask
date Sun, 31 Dec 2006 01:59:07 +0000
parents da2ca77aec83
children 39bbedccb8c0
files run/t/template_54_A.d run/t/template_54_B.d
diffstat 2 files changed, 61 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/run/t/template_54_A.d	Sun Dec 31 01:59:07 2006 +0000
@@ -0,0 +1,31 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	Kirk McDonald <kirklin.mcdonald@gmail.com>
+// @date@	2006-11-29
+// @uri@	http://d.puremagic.com/issues/show_bug.cgi?id=619
+// @desc@	[Issue 619] Alias of templated struct instance crashes 0.175
+
+
+module dstress.run.t.template_54_A;
+
+struct Foo {
+	int i;
+}
+
+template Bar(T) {
+	static Foo Bar = { 5 };
+}
+
+void dummy(int x){
+	if(x != 5){
+		assert(0);
+	}
+}
+
+int main() {
+	alias Bar!(int) inst;
+	dummy(inst.i);
+	return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/run/t/template_54_B.d	Sun Dec 31 01:59:07 2006 +0000
@@ -0,0 +1,30 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	Kirk McDonald <kirklin.mcdonald@gmail.com>
+// @date@	2006-11-29
+// @uri@	http://d.puremagic.com/issues/show_bug.cgi?id=619
+// @desc@	[Issue 619] Alias of templated struct instance crashes 0.175
+
+
+module dstress.run.t.template_54_B;
+
+struct Foo {
+	int i;
+}
+
+template Bar(T) {
+	static Foo Bar = { 5 };
+}
+
+void dummy(int x){
+	if(x != 5){
+		assert(0);
+	}
+}
+
+int main() {
+	dummy(Bar!(int).i);
+	return 0;
+}