www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 3662] New: Wrong compile error within struct constructor and C-style initializer

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

           Summary: Wrong compile error within struct constructor and
                    C-style initializer
           Product: D
           Version: 2.038
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: rayerd.wiz gmail.com


--- Comment #0 from Haruki Shigemori <rayerd.wiz gmail.com> 2010-01-01 07:17:36
PST ---
// main.d
import std.stdio;
struct S
{
    this(int x) {}
}
class A
{
    const S s = {1};
}
void main() {}


$ dmd main.d
Error: struct S has constructors, cannot use { initializers }, use S(
initializers ) instead



This error message is written to standard output, but standard error output,
and has not an error line number.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 01 2010
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3662


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ludwig informatik.uni-luebe
                   |                            |ck.de


--- Comment #1 from Don <clugdbug yahoo.com.au> 2010-02-15 02:03:08 PST ---
*** Issue 3802 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: -------
Feb 15 2010
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3662


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch
                 CC|                            |clugdbug yahoo.com.au


--- Comment #2 from Don <clugdbug yahoo.com.au> 2010-06-04 12:46:36 PDT ---
Trivial. Missing 'loc' in error call.

PATCH: init.c, StructInitializer::semantic(), line 158.

        if (ad->ctor)
-            error("%s %s has constructors, cannot use { initializers }, 
use
+             error(loc, "%s %s has constructors, cannot use { initializers },
use %s( initializers ) instead",
                ad->kind(), ad->toChars(), ad->toChars());

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 04 2010
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3662


Walter Bright <bugzilla digitalmars.com> changed:

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


--- Comment #3 from Walter Bright <bugzilla digitalmars.com> 2010-06-09
17:30:09 PDT ---
http://www.dsource.org/projects/dmd/changeset/531

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