www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10957] New: Bad diagnostic: compiler attempts to do UFCS on a non-function

http://d.puremagic.com/issues/show_bug.cgi?id=10957

           Summary: Bad diagnostic: compiler attempts to do UFCS on a
                    non-function
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: diagnostic
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: andrej.mitrovich gmail.com


--- Comment #0 from Andrej Mitrovic <andrej.mitrovich gmail.com> 2013-09-03
13:37:01 PDT ---
-----
enum string value = "foo";

struct A
{
    void test(A a)
    {
        auto x = a.value;
    }
}

void main() { }
-----

$ dmd test.d
Error: function expected before (), not "foo" of type string

It looks like the compiler attempted to do UFCS on a non-function. The above
message is reproduced with:

auto x = value(a);

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Sep 03 2013