www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Bug or feature storage class alias

reply Freddy <Hexagonalstar64 gmail.com> writes:
Is this a bug or a feature
---
import std.stdio;

int global;

alias cGlobal = const global;
alias sGlobal = shared global;

void main()
{
     global = 5;
     writeln(cGlobal);
     global = 7;
     writeln(sGlobal);
}
---
Sep 26 2015
next sibling parent Freddy <Hexagonalstar64 gmail.com> writes:
On Saturday, 26 September 2015 at 20:27:03 UTC, Freddy wrote:
 Is this a bug or a feature
I forgot to show that sGlobal is writable
Sep 26 2015
prev sibling parent Freddy <Hexagonalstar64 gmail.com> writes:
On Saturday, 26 September 2015 at 20:27:03 UTC, Freddy wrote:
 Is this a bug or a feature
Wait nevermind me, the compiler ignores those storage classes if the alias is to a symbol.
Sep 26 2015