staticIndexOf is incredibly slow and memory intensive

Timon Gehr timon.gehr at gmx.ch
Mon Aug 27 08:07:14 PDT 2012


On 08/27/2012 07:12 AM, Philippe Sigaud wrote:
> On Mon, Aug 27, 2012 at 1:00 AM, Andrej Mitrovic
> <andrej.mitrovich at gmail.com> wrote:
>
>>
>> test.d(17): Error: tuple index 4 exceeds 1
>>
>> I just noticed something though, if the order is swapped there's no error:
>> void main()
>> {
>>      alias TypeTuple!(int) x;
>>      static if (is(x[4] == int))
>>      {
>>      }
>> }
>>
>> Bug maybe?
>
> Certainly.
>

Actually it is according to the specification:

"3. is ( Type == TypeSpecialization )
The condition is satisfied if Type is semantically correct and is the 
same type as TypeSpecialization."

=> TypeSpecialization is compiled without suppressing errors.


More information about the Digitalmars-d mailing list