[Issue 7727] Allso "static initializer" for non-static unions too

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Sep 30 07:13:04 PDT 2013


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


Denis Shelomovskij <verylonglogin.reg at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |verylonglogin.reg at gmail.com
           Platform|x86                         |All
            Summary|Immutable union             |Allso "static initializer"
                   |instantiations too          |for non-static unions too
         OS/Version|Windows                     |All


--- Comment #1 from Denis Shelomovskij <verylonglogin.reg at gmail.com> 2013-09-30 18:12:58 MSD ---
The issue has nothing to do with immutability:
---
struct S { int i; double d; }
union U { int i; double d; }

void main()
{
    S s = { d: 5 }; // OK
    U u = { d: 5 }; // Error: variable main.main.u is not a static and cannot
have static initializer
}
---

By the way, docs don't mention one can do such "static initialization" for
non-static structs or unions. Anyway, the difference should be obliterated by
allowing/disallowing both.

-- 
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