www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 8154] New: Source fo error is hidden when using default-parametrized tempalte-struct

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

           Summary: Source fo error is hidden when using
                    default-parametrized tempalte-struct
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: dmitry.olsh gmail.com



05:50:12 PDT ---
struct Policy{}

struct Bogus(CT=Policy)
{
    this(int dummy)
    {
        _r = 1;
    }
}

Bogus a;

void main(){}


dmd from git commit 54056a901cd78410b96cb9bff245c231e6d6f71e outputs:

bug3.d(11): Error: struct bug3.Bogus(CT = Policy) is used as a type

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


Dmitry Olshansky <dmitry.olsh gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic
            Summary|Source fo error is hidden   |Source of error is hidden
                   |when using                  |when using
                   |default-parametrized        |default-parametrized
                   |tempalte-struct             |tempalte-struct



05:52:04 PDT ---
the real problem is seen if replaced with:

Bogus!Policy a;

bug3.d(7): Error: undefined identifier _r, did you mean variable a?

That's what I'd expect with default instantation too.

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


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

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



14:06:41 PDT ---
You didn't actually instantiate it the first time:

This:
Bogus a;

Needs to be:
Bogus!() a;

It's unfortunate D doesn't allow the first case to work though.. but that's
probably another bug report.

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