[Issue 2631] alias symbol this;

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jan 28 17:56:22 PST 2009


http://d.puremagic.com/issues/show_bug.cgi?id=2631





------- Comment #4 from jarrett.billingsley at gmail.com  2009-01-28 19:56 -------
(In reply to comment #3)
> 
> But you can do 
> 
> enum _zis = 5;
> alias this _zis;

You mean "alias _zis this;" ;)

Or, the compiler could allow aliasing expressions, and just auto-generate a
dummy 'enum' symbol to alias.  That is,

alias 5 x;

becomes

enum _x_alias = 5;
alias _x_alias x;

I've wanted aliasing to work on both expressions and symbols for a while now. 
It would make some of my templates a lot simpler.


-- 



More information about the Digitalmars-d-bugs mailing list