changeset 1571:b6eb7f46f42c

[Issue 1813] static function parametrized with alias used with delegate throws an internal compiler error. <llucax@gmail.com> 2008-02-01 http://d.puremagic.com/issues/show_bug.cgi?id=1813
author thomask
date Thu, 21 Feb 2008 13:39:51 +0000
parents 43123cf43146
children 169ba9b6cb5d
files nocompile/b/bug_tree_inline_1902_B.d run/b/bug_tree_inline_1902_A.d
diffstat 2 files changed, 58 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/nocompile/b/bug_tree_inline_1902_B.d	Thu Feb 21 13:39:51 2008 +0000
@@ -0,0 +1,30 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	<llucax@gmail.com>
+// @date@	2008-02-01
+// @uri@	http://d.puremagic.com/issues/show_bug.cgi?id=1813
+// @desc@	[Issue 1813] static function parametrized with alias used with delegate throws an internal compiler error.
+
+// __DSTRESS_ELINE__ 28
+
+module dstress.nocompile.b.bug_tree_inline_1902_B;
+
+template thunk(alias fn){
+	static void thunk(int* arg){
+		fn(arg);
+	}
+}
+
+int main(){
+	int x = 1;
+
+	void inner(int* arg){
+		if(!(arg !is &x)){
+			assert(0);
+		}
+	}
+	thunk!(inner)(&x);
+	return 0;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/run/b/bug_tree_inline_1902_A.d	Thu Feb 21 13:39:51 2008 +0000
@@ -0,0 +1,28 @@
+// $HeadURL$
+// $Date$
+// $Author$
+
+// @author@	<llucax@gmail.com>
+// @date@	2008-02-01
+// @uri@	http://d.puremagic.com/issues/show_bug.cgi?id=1813
+// @desc@	[Issue 1813] static function parametrized with alias used with delegate throws an internal compiler error.
+
+module dstress.run.b.bug_tree_inline_1902_A;
+
+template thunk(alias fn){
+	void thunk(int* arg){
+		fn(arg);
+	}
+}
+
+int main(){
+	int x = 1;
+
+	void inner(int* arg){
+		if(!(arg !is &x)){
+			assert(0);
+		}
+	}
+	thunk!(inner)(&x);
+	return 0;
+}