diff undefined/typedef_10_G.d @ 811:47da30a67c8d

Stewart Gordon <smjg_1998@yahoo.com> 2005-12-12 news:dnjnqe$16sv$1@digitaldaemon.com
author thomask
date Sun, 05 Feb 2006 09:57:55 +0000
parents
children eb7e3f644b18
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/undefined/typedef_10_G.d	Sun Feb 05 09:57:55 2006 +0000
@@ -0,0 +1,22 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	Stewart Gordon <smjg_1998@yahoo.com>
+// @date@	2005-12-12
+// @uri@	news:dnjnqe$16sv$1@digitaldaemon.com
+
+module dstress.undefined.typedef_10_G;
+
+/*	When typedefs are arithmetically combined, what should be the type of the
+ *	result?  The spec gives no indication.  This testcase asserts the way I
+ *	feel it should be. (Stewart Gordon)
+ */
+typedef int Int;
+
+int main() {
+	long l;
+	Int i;
+
+	static assert (is(typeof(l + i) == long));
+}