[Issue 17474] New: non-property being treated as a property

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Jun 6 16:08:51 PDT 2017


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

          Issue ID: 17474
           Summary: non-property being treated as a property
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: eyal at weka.io

int* gInt;

ref int* getTheIntPtr(string str = "Hello") {
    assert(str !is null);
    return gInt;
}

unittest {
    int x;
    getTheIntPtr = &x;
    getTheIntPtr = null; // oops, assertion failure
}


This has blown up and took us quite a while to figure out we were passing null
as an argument to a function when we use ASSIGNMENT syntax(!!).

--


More information about the Digitalmars-d-bugs mailing list