Shouldn't __traits return Tuples?

Trass3r mrmocool at gmx.de
Wed Apr 1 18:56:35 PDT 2009


I came across another strange bug(?):
Using const, static const or auto instead of enum makes it work.
Using the foreach way also works with enum.

void main()
{
	enum members = ["foo", "bar"];
	for (uint i=0; i<members.length; i++)
//	foreach (i; Sequence!(members.length))
	{
		writefln(members[i]);
	}
}

But enum with for yields:

object.Error: Access Violation
std.encoding.EncodingSchemeASCII            à‘B ANSI_X3.4-1968     ’B 
ANSI_X3.4-1986     (’B ASCII      @’B IBM367     P’B ISO646-US 
   	   `’B ISO_646.irv:1991           x’B US-ASCII           ˜’B 
cp367      °’B csASCIIiso-ir-6    À’B us         Ø’B ?          è’B 
€“B     std.encoding.EncodingSchemeASCII                TB        ø’B 
      “B    €“B         ”B                                    0“B 
GA ƒ@ ƒ@ pƒ@ tFA GA $GA 4GA LGA œGA ìGA ÔHA  IA `IA KA 8KA dKA 
encoding.1270           pOB
    È“B    ”B    
”B    øGA                 pkB 0“B Unable to create 
class      ”B Unrecognized Encoding:     @”B à”B 
std.encoding.EncodingScheme             TB        `”B    h”B    à”B 
         0QB                                    ”B 
                          ÔHA  IA `IA KA 8KA dKA         ЕB 
                       std.encoding.UnrecognizedEncodingException  TB 
    $   0•B *   T•B    ЕB         @–B         
 
     €•B €ƒ@ ƒ@ ƒ@ pƒ@             –B 
  std.encoding.EncodingException              TB     $   ð•B 
 
–B    –B         ðYB         
                           @–B €ƒ@ 
ƒ@ ƒ@ pƒ@             P—B 
core.exception.UnicodeException         TB     (   °–B    Ø–B    P—B 
         ðYB         
                            —B €ƒ@ ƒ@ ƒ@ pƒ@ 
          No appropriate switch clause found      "   p—B 0˜B 
                       core.exception.SwitchError  TB     $    —B  
  Ä—B    0˜B         pSB         
                           à—B 
€ƒ@ ƒ@ ƒ@ pƒ@             Hidden method called for           P˜B 
      ™B                                 core.exception.HiddenFuncError 
              TB     $   €˜B 
   ¤˜B     ™B         pSB         
 
                       ИB €ƒ@ ƒ@ ƒ@ pƒ@             Finalization 
error         @™B An exception was thrown while finalizing an instance 
of class   >   `™B         PšB 
core.exception.FinalizeError            TB     (   °™B 
   Ø™B    PšB 
         pSB         
                            šB LA ƒ@ ƒ@ pƒ@ 
          @qB             std.dateparse   pOB
    €šB    ÈšB    КB
                        ðWB @qB À©B                unrecognized 
attribute         äšB redundant attribute        ›B unmatched ')'
    (›B q          @›B            P›B printProgram()
   10:    	REchar '



More information about the Digitalmars-d mailing list