https://issues.dlang.org/show_bug.cgi?id=19533
Issue ID: 19533
Summary: "alias this" prevents "cast(void*)"
Product: D
Version: D2
Hardware: All
URL: http://dlang.org/
OS: All
Status: NEW
Severity: enhancement
Priority: P3
Component: dlang.org
Assignee: [email protected]
Reporter: [email protected]
The following program does not compile. I assume it should compile.
---
struct BNode { }
class UserObject {
BNode record;
alias record this;
void* context() { return cast(void*)this; }
}
---
$ dlang.dmd -c test.d
test.d(5): Error: cannot cast expression this.record of type BNode to void*
$ dlang.dmd --version
DMD64 D Compiler v2.083.1
--