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

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Sep 3 13:37:05 PDT 2013


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 at puremagic.com
        ReportedBy: andrej.mitrovich at gmail.com


--- Comment #0 from Andrej Mitrovic <andrej.mitrovich at 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: -------


More information about the Digitalmars-d-bugs mailing list