Summary: 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.
           Product: D
           Version: 2.025
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: ice-on-invalid-code
          Severity: minor
          Priority: P3
         Component: DMD

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.

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;}


Reply via email to