www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 19762] New: ICE on invalid code

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

          Issue ID: 19762
           Summary: ICE on invalid code
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Windows
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: elpenguino+D gmail.com

I couldn't get this down to less than 3 separate modules, and I can't even
guess which part of this is causing the crash.

Compile with -g.

a.d:
```
module a;

struct X {
        import b : Baz;
        Err err;
}
```
b.d:
```
module b;

struct Baz {
}

struct Qux {
        import c;
}
```
c.d:
```
module c;

struct Foo {
        import a : X;
        X[] x;
}

Nullable!Foo foo() {
        Nullable!Foo output;
        return output;
}

struct Nullable(T)
{
    bool opEquals(U)(const(U) rhs) const
    if (is(typeof(this.get == rhs)))
    {
        return true;
    }

    inout(T) get() inout
    {
        return T.init;
    }
}
```

--
Mar 26 2019