Thread overview
[Issue 2737] New: Nonsensical Error Message on Unsafe .idup
Mar 16, 2009
d-bugmail
Jul 09, 2011
yebblies
Jul 09, 2011
yebblies
Jul 09, 2011
yebblies
Oct 03, 2011
Walter Bright
March 16, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2737

           Summary: Nonsensical Error Message on Unsafe .idup
           Product: D
           Version: unspecified
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: diagnostic
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla@digitalmars.com
        ReportedBy: dsimcha@yahoo.com


void main() {
    uint[][] foo = [[1, 2], [3, 4], [5, 6]];
    immutable bar = foo.idup;
}

Compiler error:

test.d(3): Error: undefined identifier module test.idup
test.d(3): Error: function expected before (), not module test.idup of type
void

Of course, the compiler should not allow .idup to be applied to foo because, unless a deep copy were made, this would cause unsafe aliasing between mutable and immutable.  However, a better error message might be a good thing.


-- 

July 09, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=2737


yebblies <yebblies@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bearophile_hugs@eml.cc


--- Comment #1 from yebblies <yebblies@gmail.com> 2011-07-09 12:10:36 EST ---
*** Issue 6252 has been marked as a duplicate of this issue. ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
July 09, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=2737


yebblies <yebblies@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |yebblies@gmail.com


--- Comment #2 from yebblies <yebblies@gmail.com> 2011-07-09 12:14:49 EST ---
The error message is actually in there, it's just hidden by the hacky ufcs is implemented.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
July 09, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=2737


yebblies <yebblies@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch


--- Comment #3 from yebblies <yebblies@gmail.com> 2011-07-09 14:33:45 EST ---
https://github.com/D-Programming-Language/dmd/pull/219

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
October 03, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=2737


Walter Bright <bugzilla@digitalmars.com> changed:

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


--- Comment #4 from Walter Bright <bugzilla@digitalmars.com> 2011-10-02 22:35:02 PDT ---
https://github.com/D-Programming-Language/dmd/commit/f6fe4cc94d3210e260905ddf4c56a332c3d4f961

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