www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10807] New: Strange error message with template, __trait and property syntax

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

           Summary: Strange error message with template, __trait and
                    property syntax
           Product: D
           Version: future
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: doob me.com



The following code:

class A
{
    void size () ()
    {
        __traits(foo);
    }
}

void main ()
{
    auto a = new A;
    a.size;
}

Gives the following compile error:

Error: cannot resolve type for a.size()()
Error: dottd has no effect in expression (a.size()())

As far as I know "dottd" is an internal name in the compiler.

If I add a pair of parentheses to the call to "size" or if the method is not a
template method the correct error message appears:

Error: unrecognized trait foo
Error: long has no effect in expression (false)
Error: template instance main.A.size!() error instantiating

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 12 2013
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10807





 The following code:
 
[snip]
 
 Gives the following compile error:
 
 Error: cannot resolve type for a.size()()
 Error: dottd has no effect in expression (a.size()())
 
 As far as I know "dottd" is an internal name in the compiler.
This issue does not occur with git head (b4584d77bd). -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Aug 13 2013