const of AliasSeq is silently ignored

Paul Backus snarwin at gmail.com
Tue Apr 9 15:37:39 UTC 2019


On Monday, 8 April 2019 at 19:56:50 UTC, Yuxuan Shui wrote:
>
> In this example:
>
>     const(AliasSeq!(int, int)) a;
>     pragma(msg, typeof(a)); // (int, int)
>
> This kind of make sense, since AliasSeq is not a "single" type. 
> But silently dropping const seems bad, the compiler should 
> probably report an error/warning in this case?

It works if you use the "storage class" syntax for const:

const AliasSeq!(int, int) a;
pragma(msg, typeof(a)); // (const(int), const(int))


More information about the Digitalmars-d-learn mailing list