So, User-Defined Attributes

Walter Bright newshound2 at digitalmars.com
Fri Jan 4 15:22:08 PST 2013


On 1/4/2013 2:03 PM, Max Samukha wrote:
> On Friday, 4 January 2013 at 20:40:39 UTC, Walter Bright wrote:
>> Hence, no, you cannot use alias to modify the attributes.
>
> You can:
>
> public struct S
> {
> }
>
> private alias S S2; // visibility attribute is changed.

I'm not really sure if this is an issue or not. I'll have to think about it. The 
visibility "attribute" is a bit of an oddity.

> Type modifiers:
>
> alias const(S) S2; // mutability attribute is changed.

This is not a bug. const(S) is a type constructor, not an attribute, and you are 
aliasing a type, not a symbol.



More information about the Digitalmars-d mailing list