Bug? tupleof and const string = ""

Dicebot public at dicebot.lv
Thu Feb 13 09:12:26 PST 2014


On Thursday, 13 February 2014 at 16:57:19 UTC, John Colvin wrote:
> Don't you mean const/immutable fields with initialisers don't 
> become instance fields? Or is this actually as strange as it 
> sounds?

Yes, it is legacy behavior (== bug) that persisted since D1 days 
and was addressed only recently. Until this 
deprecation/transition process will end this:

struct X
{
     const string value = "literal"'
}

is effectively same as this:

struct X
{
     enum value = "literal"'
}


More information about the Digitalmars-d-learn mailing list