Alias example should supposedly be illegal, but runs fine

codephantom me at noyb.com
Tue Dec 19 01:19:34 UTC 2017


On Monday, 18 December 2017 at 23:44:46 UTC, Michael wrote:
>
> alias a = s.i; // illegal, s.i is an expression

Actually, as I understand it, the example provided in 10. is 
legal (because it aliases a type), and the example provided in 3. 
is illegal (because it aliases an expression)

perhaps the examples in 10 and 3 should be swapped.

https://dlang.org/spec/declaration.html#alias



More information about the Digitalmars-d-learn mailing list