Thread overview
[Issue 7929] New: Broken semantic of StructInitializer with const
Apr 17, 2012
Kenji Hara
Apr 17, 2012
Kenji Hara
Apr 20, 2012
Walter Bright
April 17, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7929

           Summary: Broken semantic of StructInitializer with const
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: k.hara.pg@gmail.com


--- Comment #0 from Kenji Hara <k.hara.pg@gmail.com> 2012-04-16 18:01:45 PDT ---
From d.learn newsgroup: http://forum.dlang.org/thread/jmhbk2$ra2$1@digitalmars.com#post-jmhbk2:24ra2:241:40digitalmars.com

struct S
{
    int [] numbers;
}

void main()
{
    const int [] numbers = new int[2];
    const S si = {numbers};
    // Error: cannot implicitly convert expression (numbers) of type
    // const(int[]) to int[]

    const S se = const(S)(numbers);
    // OK
}

This is a bug in processing StructInitializer semantic.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
April 17, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7929


Kenji Hara <k.hara.pg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull


--- Comment #1 from Kenji Hara <k.hara.pg@gmail.com> 2012-04-16 18:07:09 PDT ---
https://github.com/D-Programming-Language/dmd/pull/884

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
April 19, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7929



--- Comment #2 from github-bugzilla@puremagic.com 2012-04-19 15:59:06 PDT ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/849ca3c0a4946a237d30f4a2b860299632d987e7 fix Issue 7929 - Broken semantic of StructInitializer with const

https://github.com/D-Programming-Language/dmd/commit/466760e7d817e4276e749c6054cd8a8387f3a437 Merge pull request #884 from 9rnsr/fix7929

Issue 7929 - Broken semantic of StructInitializer with const

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
April 20, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7929


Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla@digitalmars.com
         Resolution|                            |FIXED


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