Thread overview
[Issue 7621] New: Immutable type equivalence problem
Mar 25, 2012
Kenji Hara
Mar 26, 2012
Walter Bright
March 01, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=7621

           Summary: Immutable type equivalence problem
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: bearophile_hugs@eml.cc


--- Comment #0 from bearophile_hugs@eml.cc 2012-03-01 13:14:49 PST ---
I don't understand this bug. D2 code:


void main() {
    enum uint N = 4u;
    char[] A = "hello".dup;
    uint[immutable char[N]] dict;
    dict[*cast(immutable char[4]*)(A[0 .. N].ptr)] = 0; // OK
    dict[*cast(immutable char[N]*)(A[0 .. N].ptr)] = 0; // line 6, error
}


DMD 2.059head gives:

test.d(6): Error: cannot implicitly convert expression
(*cast(immutable(char[N]*))cast(char*)A[0u..4u]) of type immutable(char[N]) to
immutable(char[4u])

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


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull
           Platform|x86                         |All
         OS/Version|Windows                     |All


--- Comment #1 from Kenji Hara <k.hara.pg@gmail.com> 2012-03-24 23:04:24 PDT ---
https://github.com/D-Programming-Language/dmd/pull/838

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


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