Error: template instance `Reflect!(type)` cannot use local `type` as parameter to non-global template `Reflect(Ts...)()`

Nicholas Wilson iamthewilsonator at hotmail.com
Sun Apr 7 05:30:49 UTC 2019


On Sunday, 7 April 2019 at 05:24:38 UTC, Alex wrote:
> Error: template instance `Reflect!(type)` cannot use local 
> `type` as parameter to non-global template `Reflect(Ts...)()`
>
> mixin(`import `~moduleName!(T)~`;`);	
> mixin(`alias X = T.`~name~`;`);			
> super.Reflect!(X);
>
> I realize X is local but I'm trying to figure out why it can't 
> be passed to a "non-global" template.

See 
https://blog.thecybershadow.net/2015/04/28/the-amazing-template-that-does-nothing/

TL;DR

At global scope
alias Identity(alias X) = X;

then where the error is issued from use `Identity!(type)` instead 
of type.


More information about the Digitalmars-d-learn mailing list