[dmd-beta] Weird Delegate Error: Regression?

David Simcha dsimcha at gmail.com
Sat Jun 12 07:53:40 PDT 2010


The following code works in 2.046:

import std.traits;

template IterType(T) {
     alias ReturnType!(
         {
             foreach(elem; T.init) {
                 return elem;
             }
             assert(0);
         }) IterType;
}

alias IterType!(uint[]) foo;

In 2.047 beta it fails with the nonsensical error message:

test8.d(6): Error: delegate std.traits.__dgliteral1 cannot access frame 
of function __dgliteral1



More information about the dmd-beta mailing list