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: [email protected]
Reporter: [email protected]
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(!!).
--