Bug 11317 – glue.c:1218: virtual unsigned int Type::totym(): Assertion `0' failed.

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-10-21T12:55:00Z
Last change time
2013-11-15T23:25:26Z
Keywords
ice, pull
Assigned to
nobody
Creator
rswhite4
Blocks
11322

Comments

Comment #0 by rswhite4 — 2013-10-21T12:55:05Z
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
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/9ba50eecb45ce883130f36a96408dac767b276f0 fix Issue 11317 - glue.c:1218: virtual unsigned int Type::totym(): Assertion `0' failed. Make ref-ness deduction and return type inference orthogonal. https://github.com/D-Programming-Language/dmd/commit/38c51e74395c2daede20474c656477a75fafbeb7 Merge pull request #2766 from 9rnsr/fix11317 Issue 11317 - glue.c:1218: virtual unsigned int Type::totym(): Assertion `0' failed.
Comment #3 by k.hara.pg — 2013-11-15T23:25:26Z