D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 10957 - Bad diagnostic: compiler attempts to do UFCS on a non-function
Summary: Bad diagnostic: compiler attempts to do UFCS on a non-function
Status: NEW
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P3 normal
Assignee: No Owner
URL:
Keywords: diagnostic
: 20499 (view as issue list)
Depends on:
Blocks:
 
Reported: 2013-09-03 13:37 UTC by Andrej Mitrovic
Modified: 2024-12-13 18:11 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Andrej Mitrovic 2013-09-03 13:37:01 UTC
-----
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);
Comment 1 basile-z 2023-10-16 08:57:46 UTC
*** Issue 20499 has been marked as a duplicate of this issue. ***
Comment 2 dlangBugzillaToGithub 2024-12-13 18:11:10 UTC
THIS ISSUE HAS BEEN MOVED TO GITHUB

https://github.com/dlang/dmd/issues/18664

DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB