http://d.puremagic.com/issues/show_bug.cgi?id=6917

           Summary: with() at global scope too
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@eml.cc 2011-11-08 19:24:43 PST ---
A correct D2 program that defines a global immutable array of enum members:


enum MyEnum { first, second }
immutable MyEnum[] array = [MyEnum.first,MyEnum.second,MyEnum.second,
                            MyEnum.first,MyEnum.second,MyEnum.second];
void main() {}


To reduce the noise I'd like to use with() at global scope too (there is no
need to call is "static with"):


enum MyEnum { first, second }
with (MyEnum) {
    immutable MyEnum[] array = [first,second,second,first,second,second];
}
void main() {}


with is useful for global structs too.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to