www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 17474] New: non-property being treated as a property

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 puremagic.com
          Reporter: eyal 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(!!).

--
Jun 06 2017