# HG changeset patch # User thomask # Date 1203601191 0 # Node ID b6eb7f46f42c49d269cc5c284717a03387a205cf # Parent 43123cf43146a500cd019c3cfa307cd14a172940 [Issue 1813] static function parametrized with alias used with delegate throws an internal compiler error. 2008-02-01 http://d.puremagic.com/issues/show_bug.cgi?id=1813 diff -r 43123cf43146 -r b6eb7f46f42c nocompile/b/bug_tree_inline_1902_B.d --- /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@ +// @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; +} diff -r 43123cf43146 -r b6eb7f46f42c run/b/bug_tree_inline_1902_A.d --- /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@ +// @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; +}