ICE: template.c:806: failed assertion `i < parameters->dim'

Don nospam at nospam.com
Thu Oct 29 01:04:01 PDT 2009


grauzone wrote:
> Don wrote:
>> Jacob Carlborg wrote:
>>> On 10/28/09 16:32, Don wrote:
>>>> Jacob Carlborg wrote:
>>>>> I have quite a big project and when I compile it I get this internal
>>>>> compiler error: template.c:806: failed assertion `i < 
>>>>> parameters->dim'.
>>>>> I don't know what could cause that error so I don't know where to look
>>>>> in my code to try to produce a small test case and report an issue.
>>>>> I'm using quite a lot of templates, template mixins and string mixins.
>>>>
>>>> Bugzilla 2229. Was fixed in DMD1.049.
>>>> There have been about 60 ICE bugs fixed since 1.045.
>>>> I want to find out what the regressions are that are stopping people
>>>> from using the latest DMD -- it's time for the ICE age to end.
>>>
>>> I haven't been using any later version because of various known 
>>> regressions, I think they've been solved know. I tried to compile 
>>> Tango trunk with DMD trunk and it failed with:
>>>
>>> /Users/doob/development/d/tango-trunk/build/user/../../user/tango/io/compress/BzipStream.d(270): 
>>> Error: var has no effect in expression (w)
>>>
>>> It's returning a value in a void function.
>>>
>>> I don't know if it's a regression that hasn't been solved or if it's 
>>> something wrong with Tango.
>>
>> The compiler now catches a few bugs that used to slip past before. 
>> Just change the "return w;" into "return;".
> 
> I thought that was a feature?

It's OK for a void function to return another void function, and it's OK 
if the expression has side-effects. The situations which have been 
disallowed are ones where the compiler used to completely ignore the 
expression, generating no code at all. It's now treated exactly the same 
as if you wrote:

  w;
  return;

The bug was that although the compiler has always done that 
transformation, it wasn't running the semantic pass on it.



More information about the Digitalmars-d mailing list