Bug 8484 – [CTFE] Assertion failure: 'thisval && thisval->op == TOKclassreference' on line 4896 in file 'interpret.c'.

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2012-07-31T05:12:00Z
Last change time
2015-06-09T05:10:41Z
Keywords
pull
Assigned to
nobody
Creator
sweatygarlic

Comments

Comment #0 by sweatygarlic — 2012-07-31T05:12:41Z
class C { bool b() {return true;} } struct S { C c; } bool t( ref C c ){ return c.b; } bool test() { auto s = S(new C); return t(s.c); } static assert(test()); --- causes "Assertion failure: 'thisval && thisval->op == TOKclassreference' on line 4896 in file 'interpret.c'" on dmd 2.059 this is similar to the issue 7158 http://d.puremagic.com/issues/show_bug.cgi?id=7158 and the issue 4257 http://d.puremagic.com/issues/show_bug.cgi?id=4257
Comment #1 by clugdbug — 2012-09-11T06:14:39Z
Comment #2 by github-bugzilla — 2012-09-11T15:24:03Z
Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/fde72f585147009078d14eeb82b18cd91b00490e Fix issue 8484 [CTFE] ICE(interpret.c) calling member of class passed by reference We need to resolve references before determining which function to call.
Comment #3 by k.hara.pg — 2012-09-21T09:00:57Z
D2 branch is already fixed, but D1 has same issue.
Comment #4 by k.hara.pg — 2012-09-23T18:52:43Z