Created attachment 1286
Code as above, with commentary
Here's a minimal example of the problem, extracted and simplified laboriously
from real code. I only verified it on Windows and Linux, see below for details.
struct blah {}
struct blah_ptr {
blah* ptr;
alias ptr this;
}
void f() {
int irrelevant;
blah* bptr = cast(blah_ptr)&irrelevant;
}
/*
DMD32 D Compiler v2.063.2 (Windows)
DMD64 D Compiler v2.063.2 (Linux)
dmd -c bug.d
Internal error: ..\ztc\cod4.c 358
*/
Comment #1 by luk.wrzosek — 2015-04-04T12:16:53Z
DMD 2.67 works with the test case:
bug.d(10): Error: cannot cast expression & irrelevant of type int* to blah_ptr