Mercurial > projects > dstress
changeset 1342:82f276a0af1f
[Issue 908] compiler dies trying to inline static method call to nonstatic method in template code.
Kevin Bealer <kevinbealer@gmail.com>
2007-01-30
http://d.puremagic.com/issues/show_bug.cgi?id=908
author | thomask |
---|---|
date | Wed, 14 Feb 2007 10:07:40 +0000 |
parents | 91d9ee75837a |
children | ac6065ff268b |
files | nocompile/i/inline_18_A.d nocompile/i/inline_18_B.d |
diffstat | 2 files changed, 67 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nocompile/i/inline_18_A.d Wed Feb 14 10:07:40 2007 +0000 @@ -0,0 +1,34 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Kevin Bealer <kevinbealer@gmail.com> +// @date@ 2007-01-30 +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=908 +// @desc@ [Issue 908] compiler dies trying to inline static method call to nonstatic method in template code. + +// __DSTRESS_ELINE__ 22 + +module dstress.nocompile.i.inline_18_A; + +class C { + final uint next(){ + return 1; + } +} + +template Foo(T) { + void bar(){ + int r = C.next; + } +} + +int main(){ + C prng = new C(); + alias Foo!(int).bar baz; + + int x = prng.next; + baz(); + + return 0; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/nocompile/i/inline_18_B.d Wed Feb 14 10:07:40 2007 +0000 @@ -0,0 +1,33 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Kevin Bealer <kevinbealer@gmail.com> +// @date@ 2007-01-30 +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=908 +// @desc@ [Issue 908] compiler dies trying to inline static method call to nonstatic method in template code. + +// __DSTRESS_ELINE__ 22 + +module dstress.nocompile.i.inline_18_B; + +class C { + final uint next(){ + return 1; + } +} + +template Foo(T) { + void bar(){ + int r = C.next; + } +} + +int main(){ + C prng = new C(); + alias Foo!(int).bar baz; + + baz(); + + return 0; +}