[Issue 23861] New: Compiler segmentation fault with ref and alias this

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Apr 26 01:03:48 UTC 2023


https://issues.dlang.org/show_bug.cgi?id=23861

          Issue ID: 23861
           Summary: Compiler segmentation fault with ref and alias this
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: zach-dmd at cs.stanford.edu

Attempting to compile the following code with DMD v2.103.0 causes a
segmentation fault in DMD:

```
Foo global;

struct Foo {
    ref Foo get() {
        return global;
    }
    alias get this;
}

void main() {
    Foo g;
    g = 3;
}
```

--


More information about the Digitalmars-d-bugs mailing list