Mercurial > projects > dstress
changeset 1335:fab5c8b013c2
[Issue 165] type inference fails with sizeof and circular imports
Don Clugston <clugdbug@yahoo.com.au>
2006-05-30
http://d.puremagic.com/issues/show_bug.cgi?id=165
author | thomask |
---|---|
date | Tue, 23 Jan 2007 12:02:56 +0000 |
parents | 879e46d4cb05 |
children | 986983b8cf7a |
files | compile/c/const_42_A.d compile/c/const_42_B.d |
diffstat | 2 files changed, 42 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compile/c/const_42_A.d Tue Jan 23 12:02:56 2007 +0000 @@ -0,0 +1,17 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Don Clugston <clugdbug@yahoo.com.au> +// @date@ 2006-05-30 +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=165 +// @desc@ [Issue 165] type inference fails with sizeof and circular imports + +// __DSTRESS_DFLAGS__ compile/c/const_42_B.d + +module /*dstress.*/compile.c.const_42_A; +import /*dstress.*/compile.c.const_42_B; + +struct wolf { + int armadillo; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compile/c/const_42_B.d Tue Jan 23 12:02:56 2007 +0000 @@ -0,0 +1,25 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Don Clugston <clugdbug@yahoo.com.au> +// @date@ 2006-05-30 +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=165 +// @desc@ [Issue 165] type inference fails with sizeof and circular imports + +// __DSTRESS_DFLAGS__ compile/c/const_42_A.d + +module /*dstress.*/compile.c.const_42_B; +import /*dstress.*/compile.c.const_42_A; + +struct dog { + wolf donkey; + struct sheep { + char pig; + } +} + +const X = dog.sheep.pig.sizeof; + +static assert(is(typeof(X) == typeof(char.sizeof))); +static assert(X == char.sizeof);