www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 8270] New: Different error messages for missing const in var[] and var.opSlice()

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

           Summary: Different error messages for missing const in var[]
                    and var.opSlice()
           Product: D
           Version: D2
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: minor
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: xammy xammy.homelinux.net



01:19:59 PDT ---
Consider the following code:

struct S
{
  void opSlice() { }
}

void main()
{
  const(S) s;
  s[];
  s.opSlice();
}

It results in two error messages from which the second is correct since it
comlains about opSlice not being const but s being a const(S). The first one
misses this information.

Error: function main.S.opSlice () is not callable using argument types ()
Error: function main.S.opSlice () is not callable using argument types () const

This bug does not seem to affect other operators like opIndex or opCall.

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


Andrej Mitrovic <andrej.mitrovich gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |andrej.mitrovich gmail.com
         Resolution|                            |FIXED



16:11:04 PST ---


However it will also get better after pull 1407 is merged
(http://d.puremagic.com/issues/show_bug.cgi?id=8270):

test.d(12): Error: mutable method test.S.opSlice is not callable using const
object
test.d(13): Error: mutable method test.S.opSlice is not callable using const
object

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




16:11:30 PST ---


 
 However it will also get better after pull 1407 is merged
 (http://d.puremagic.com/issues/show_bug.cgi?id=8270):
Wrong like, should be: https://github.com/D-Programming-Language/dmd/pull/1407 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Dec 26 2012