Cannot use locat x as parameter to non-global template y

simendsjo simendsjo at gmail.com
Sun Sep 22 06:36:47 PDT 2013


On Sunday, 22 September 2013 at 12:26:03 UTC, bearophile wrote:
> simendsjo:
>
>> God, I hate these errors. Tried updating dmd head, and these 
>> started popping up.
>> Now I have to move all templates out...
>
> Can you show a small example of code that gives that error?
>
> Bye,
> bearophile

dustmite for the win!

template A(T...) {
     template B(alias T) { }
}

void main() {
     void fv() {}
     alias A!(fv) F;
     F.B!F;
}

dmd -unittest t.d
t.d(8): Error: template instance B!(A!(fv)) cannot use local 
'A!(fv)' as parameter to non-global template B(alias T)


More information about the Digitalmars-d-learn mailing list