Mercurial > projects > dstress
diff run/o/odd_bug_11_C.d @ 1297:c6b68d917f83
[Issue 654] Const string member using implicit type inference gives garbage in certain situation
Christopher Pellng <chris@inventivedingo.com>
2006-12-05
http://d.puremagic.com/issues/show_bug.cgi?id=654
author | thomask |
---|---|
date | Sat, 30 Dec 2006 15:40:25 +0000 |
parents | |
children | 36bedfa079e6 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/o/odd_bug_11_C.d Sat Dec 30 15:40:25 2006 +0000 @@ -0,0 +1,32 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Christopher Pellng <chris@inventivedingo.com> +// @date@ 2006-12-05 +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=654 +// @desc@ [Issue 654] Const string member using implicit type inference gives garbage in certain situation + +module dstress.run.o.odd_bug_11_C; + +class A { + static MY_CONST_STRING = "hello"; + + this(char[] cmp) { + if(cmp != MY_CONST_STRING){ + assert(0); + } + } +} + +void dummy(...){} + +void never_called() { + dummy("%s", A.MY_CONST_STRING); +} + +int main() { + A a = new A("hello"); + + return 0; +}