D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 10546 - UFCS hides actual static assert failure in opDispatch
Summary: UFCS hides actual static assert failure in opDispatch
Status: RESOLVED DUPLICATE of issue 8387
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 minor
Assignee: No Owner
URL:
Keywords: diagnostic
Depends on:
Blocks:
 
Reported: 2013-07-04 23:19 UTC by Kenji Hara
Modified: 2013-11-16 21:06 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 Kenji Hara 2013-07-04 23:19:18 UTC
From: http://forum.dlang.org/post/zxhvyfitqkbvmfseyqxr@forum.dlang.org

struct Fail1
{
    void opDispatch(string s)()
    {
        static assert(false, "Tried to call a method on Fail1");
    }
}

struct Fail2
{
    void opDispatch(string s, T)(T arg)
    {
        static assert(false, "Tried to call a method on Fail2");
    }
}

void main()
{
    auto fail1 = Fail1();
    fail1.s();  // "no property" error instead of static asset failure

    auto fail2 = Fail2();
    fail2.s(1); // "no property" error instead of static asset failure
}
Comment 1 yebblies 2013-11-16 21:06:38 UTC

*** This issue has been marked as a duplicate of issue 8387 ***