www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 6779] New: Error: can only initialize const member xxx inside constructor - not const, no line number

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

           Summary: Error: can only initialize const member xxx inside
                    constructor - not const, no line number
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: steve.teale britseyeview.com



07:34:21 PDT ---
import mysql;
// The import mysql.d contains only:
/*
extern (C):
struct MYSQL{}
MYSQL* mysql_init(MYSQL* mysql);
*/
// If I put this stuff in-line the error does not happen

struct Connection

{

   MYSQL _mysql;


   ~this()

   {

   }



   this(int dummy = 0)

   {
      mysql_init(&_mysql);
   }

}


// dmd -c mysqld.d
//
// Error: can only initialize const member _mysql inside constructor
// Error: this is not mutable

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 07 2011
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6779


Stewart Gordon <smjg iname.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |smjg iname.com



I'm confused.  const doesn't appear anywhere in the code.  And I can't
reproduce the error under DMD 2.057, Win32.  Can you reproduce it in any
current DMD version?

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


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

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



19:27:39 PST ---
I've tried as far as DMD 2.032, can't reproduce.

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