www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 8442] New: [2.060 beta] Empty array enum not treated as immutable

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8442

           Summary: [2.060 beta] Empty array enum not treated as immutable
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: regression
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: cbkbbejeap mailinator.com



14:31:08 PDT ---
-------------------------------------
enum int[] fooEnum = [];
immutable fooImmutable = fooEnum;
-------------------------------------
testImmutableEnum.d(2): Error: cannot implicitly convert expression ([]) of
type int[] to immutable(int[])
-------------------------------------

Worked on 2.059. If fooEnum is *not* empty, the problem disappears.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 25 2012
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8442




Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/99ea168b02260bbb067a5ac7783df32dfe6fad66
fix Issue 8442 - [2.060 beta] Empty array enum not treated as immutable

This is a regression of fixing issue 2006.
If empty array literal has the type T[] and T isn't void, should check proper
element type convertible (T[] to U --> T to U).

https://github.com/D-Programming-Language/dmd/commit/c607144504055bb16eb366e90e2af9e34e8bdac9


Issue 8442 - [2.060 beta] Empty array enum not treated as immutable

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 28 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8442


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

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



https://github.com/D-Programming-Language/dmd/pull/1065

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 28 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8442


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|unspecified                 |D1 & D2



D1 has similar problem.

const int[] fooEnum1 = [1];
const int[] fooEnum0 = [];

void main()
{
    const int[1] fooImmutable1 = fooEnum1;  // OK
    const int[0] fooImmutable0 = fooEnum0;  // Error
    // test.d(2): Error: cannot implicitly convert expression ([]) of type
int[] to int[0u]
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 28 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8442




D1 commit:
https://github.com/D-Programming-Language/dmd/commit/7621376e51368aee04aab721a8866331a13db3da

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 28 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8442


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


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