[Issue 10208] New: Module-level const/immutable variables with initialization value don't support UDAs
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed May 29 13:07:25 PDT 2013
http://d.puremagic.com/issues/show_bug.cgi?id=10208
Summary: Module-level const/immutable variables with
initialization value don't support UDAs
Product: D
Version: D2
Platform: x86
OS/Version: Windows
Status: NEW
Keywords: rejects-valid
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: bearophile_hugs at eml.cc
--- Comment #0 from bearophile_hugs at eml.cc 2013-05-29 13:07:23 PDT ---
DMD 2.063beta7:
@( 10) enum int x01 = 100;
@( 20) int x02;
@( 30) const int x03;
@( 40) immutable int x04;
@( 50) int x05 = 500;
@( 60) const int x06 = 600;
@( 70) immutable int x07 = 700;
@( 80) __gshared enum int x08 = 800;
@( 90) __gshared int x09;
@(100) __gshared const int x10;
@(110) __gshared immutable int x11;
@(120) __gshared int x12 = 1200;
@(130) __gshared const int x13 = 1300;
@(140) __gshared immutable int x14 = 1400;
pragma(msg, __traits(getAttributes, x01)); // OK
pragma(msg, __traits(getAttributes, x02)); // OK
pragma(msg, __traits(getAttributes, x03)); // OK
pragma(msg, __traits(getAttributes, x04)); // OK
pragma(msg, __traits(getAttributes, x05)); // OK
pragma(msg, __traits(getAttributes, x06)); // Error
pragma(msg, __traits(getAttributes, x07)); // Error
pragma(msg, __traits(getAttributes, x08)); // OK
pragma(msg, __traits(getAttributes, x09)); // OK
pragma(msg, __traits(getAttributes, x10)); // OK
pragma(msg, __traits(getAttributes, x11)); // OK
pragma(msg, __traits(getAttributes, x12)); // OK
pragma(msg, __traits(getAttributes, x13)); // Error
pragma(msg, __traits(getAttributes, x14)); // Error
void main() {}
Problem found by Dicebot and Jack Applegame, and reported by me after
suggestion by Kenji Hara:
http://forum.dlang.org/post/iqfqmapsksrpmoaxaqlf@forum.dlang.org
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list