Bug 2755 – ICE on invalid ref returns in linked objects: Assertion failure: 'type' on line 6566 in file 'expression.c'. No ICE or error if invalid code is local to the file.

Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2009-03-22T23:25:00Z
Last change time
2015-06-09T01:21:08Z
Keywords
ice-on-invalid-code
Assigned to
bugzilla
Creator
sandford

Comments

Comment #0 by sandford — 2009-03-22T23:25:23Z
An internal compiler error (ICE) occurs when an invalid ref return defined in another object (i.e. linked) is accessed. This error disappears (and no warning given) if the invalid ref returns are in the same object. Specifically Assertion failure: 'type' on line 6566 in file 'expression.c' is reported and then an abnormal program termination occurs. Test code --- module a; import b; void main() { myClass mc; myStruct ms; mc.self; // ICE ms.self; // ICE myFunc(); // ICE } --- module b; class myClass { ref self() { return this; } } struct myStruct { ref self() { return this; } } int y = 0; ref myFunc() {return y;}
Comment #1 by bugzilla — 2009-04-01T13:57:28Z
Fixed DMD 2.027