struct Test {
public:
@property
auto ref uint length() const pure nothrow {
return 0;
}
@property
void length(uint len) {
}
}
void main()
{
Test t;
t.length += 2;
}
Throws:
/d259/f777.d(7): Error: constant 0u is not an lvalue
dmd: glue.c:1218: virtual unsigned int Type::totym(): Assertion `0' failed.
with dmd 2.063.2
Comment #1 by yebblies — 2013-11-14T04:57:43Z
void test11317()
{
auto ref uint fun11317()
{
return 0;
}
assert(fun11317() == 0);
}
fun11317 is correctly inferred to be non-ref, but the glue layer (seeing that tf->isref is true) tries to take the address of it anyway. Hence the error, which causes the ice.
https://github.com/D-Programming-Language/dmd/pull/2763
Comment #2 by github-bugzilla — 2013-11-14T12:44:32Z