What version do you use? In 2.058head(commit f8887855), `dmd -H -c test.d` succeeds to compile without DMD assertion.
Kenji Hara 2012/1/23 Adam Wilson <flybo...@gmail.com>: > Does anyone have any idea why DMD would assert with the following assert on > this code while building the druntime during DI generation? > > Generating This DI file... > // D import file generated from 'src\core\bitop.d' > module core.bitop; > nothrow > { > pure int bsf(size_t v); > > pure int bsr(size_t v); > > pure int bt(in size_t* p, size_t bitnum); > > int btc(size_t* p, size_t bitnum); > int btr(size_t* p, size_t bitnum); > int bts(size_t* p, size_t bitnum); > pure uint bswap(uint v); > > ubyte inp(uint port_address); > ushort inpw(uint port_address); > uint inpl(uint port_address); > ubyte outp(uint port_address, ubyte value); > ushort outpw(uint port_address, ushort value); > uint outpl(uint port_address, uint value); > int popcnt(uint x); > debug (UnitTest) > { > } > uint bitswap(uint x); > debug (UnitTest) > { > } > } > > produces this assert in DMD: assert cast.c(2082) t1->ty == t2->ty > which appears to be the typeMerge function in cast.c > > It doesn't do this on all DI files and I am at a loss as to any rhyme or > reason for when it does assert. Perhaps someone with knowledge of the > compiler internals could be of help... > > Any ideas would be very helpful! > > -- > Adam Wilson > Project Coordinator > The Horizon Project > http://www.thehorizonproject.org/