[Issue 19181] New: Semantic errors in opDispatch argument lead to "no property X"

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Aug 20 06:06:44 UTC 2018


https://issues.dlang.org/show_bug.cgi?id=19181

          Issue ID: 19181
           Summary: Semantic errors in opDispatch argument lead to "no
                    property X"
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: default_357-line at yahoo.de

$ dmd test.d
test.d(9): Error: no property foo for type S
---
module test;

struct S {
    void opDispatch(string name, T)(T arg) { }
}

void main() {
    S s;
    s.foo(LanguageError);
}
---


Note that as compared to Issue 14145, the problem here is that the *call* to
opDispatch doesn't even compile, which should surely error on its own. There is
no way that opDispatch can be written that makes this code valid.

--


More information about the Digitalmars-d-bugs mailing list