Why can't I assign a mixin to an alias?

David Nadlinger via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Jun 10 18:53:10 PDT 2016


On Friday, 10 June 2016 at 22:38:29 UTC, Dechcaudron wrote:
> Error: basic type expected, not mixin
>
> Why should it be like that? I believe the compiler should not 
> impose restrictions on what mixins can or cannot do :/

This might be a gratuitous grammar restriction. There are a few 
of those surrounding alias "targets". A template that simply 
returns its parameter might work, though, such as std.meta.Alias 
(alias foo = Alias!(mixin(…));).

  — David


More information about the Digitalmars-d-learn mailing list