Bug 10208 – Module-level const/immutable variables with initialization value don't support UDAs

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-05-29T13:07:00Z
Last change time
2013-06-01T16:02:35Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2013-05-29T13:07:23Z
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/[email protected]
Comment #1 by k.hara.pg — 2013-05-30T02:33:38Z
Comment #2 by github-bugzilla — 2013-05-31T21:02:56Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/ff7270da2b14503c723124f840a69cb8adebe3df fix Issue 10208 - Module-level const/immutable variables with initialization value don't support UDAs https://github.com/D-Programming-Language/dmd/commit/4aac3b50b4516974d4b9e42b268c0ef7f6667a7c Merge pull request #2100 from 9rnsr/fix10208 Issue 10208 - Module-level const/immutable variables with initialization value don't support UDAs
Comment #3 by github-bugzilla — 2013-06-01T11:26:14Z
Commit pushed to 2.063 at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/19c35c853041d5c64c5d0ad5869182e42c3f029b Merge pull request #2100 from 9rnsr/fix10208 Issue 10208 - Module-level const/immutable variables with initialization value don't support UDAs
Comment #4 by github-bugzilla — 2013-06-01T16:02:35Z