changeset 1540:94c9f2f9af4b

[Issue 1259] Inline build triggers an illegal error msg "Error: S() is not an lvalue" <onlystupidspamhere@yahoo.se> 2007-06-06 http://d.puremagic.com/issues/show_bug.cgi?id=1259
author thomask
date Sun, 01 Jul 2007 13:17:51 +0000
parents eb6a99028b95
children fe62f80b7ea1
files run/t/tuple_25_A.d run/t/tuple_25_B.d run/t/tuple_25_C.d
diffstat 3 files changed, 93 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/run/t/tuple_25_A.d	Sun Jul 01 13:17:51 2007 +0000
@@ -0,0 +1,31 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	<onlystupidspamhere@yahoo.se>
+// @date@	2007-06-06
+// @uri@	http://d.puremagic.com/issues/show_bug.cgi?id=1259
+// @desc@	[Issue 1259] Inline build triggers an illegal error msg "Error: S() is not an lvalue"
+
+module dstress.run.t.tuple_25_A;
+
+struct S(T...) {
+	S opMul_r(double r) {
+		return S();
+	}
+	
+	S!(1) opDiv(R)(R r) {
+		return S!(1)();
+	}
+}
+
+int main() {
+	S!(1) a;
+	S!(0) b;
+	auto c = 1.0 * a / b;
+
+	if(S!(1)() != c){
+		assert(0);
+	}
+	return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/run/t/tuple_25_B.d	Sun Jul 01 13:17:51 2007 +0000
@@ -0,0 +1,31 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	<onlystupidspamhere@yahoo.se>
+// @date@	2007-06-06
+// @uri@	http://d.puremagic.com/issues/show_bug.cgi?id=1259
+// @desc@	[Issue 1259] Inline build triggers an illegal error msg "Error: S() is not an lvalue"
+
+module dstress.run.t.tuple_25_B;
+
+struct S(T...) {
+	S opMul_r(double r) {
+		return S();
+	}
+	
+	S!(1) opDiv(R)(R r) {
+		return S!(1)();
+	}
+}
+
+int main() {
+	S!(1) a;
+	S!(0) b;
+	auto c = 1.0 * a;
+
+	if(S!(1)() != c){
+		assert(0);
+	}
+	return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/run/t/tuple_25_C.d	Sun Jul 01 13:17:51 2007 +0000
@@ -0,0 +1,31 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	<onlystupidspamhere@yahoo.se>
+// @date@	2007-06-06
+// @uri@	http://d.puremagic.com/issues/show_bug.cgi?id=1259
+// @desc@	[Issue 1259] Inline build triggers an illegal error msg "Error: S() is not an lvalue"
+
+module dstress.run.t.tuple_25_C;
+
+struct S(T...) {
+	S opMul_r(double r) {
+		return S();
+	}
+	
+	S!(1) opDiv(R)(R r) {
+		return S!(1)();
+	}
+}
+
+int main() {
+	S!(1) a;
+	S!(0) b;
+	auto c = 1.0 * a / 0.5;
+
+	if(S!(1)() != c){
+		assert(0);
+	}
+	return 0;
+}