www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 22054] New: Referencing a fwd-declared field results in many

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

          Issue ID: 22054
           Summary: Referencing a fwd-declared field results in many error
                    messages
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: pro.mathias.lang gmail.com

```
class exception;

void main ()
{
    assert(exception.what() == "Hello");
}
```

This results in:
```
what.d(1): Error: class `what.exception` is forward referenced when looking for
`what`
what.d(1): Error: class `what.exception` is forward referenced when looking for
`opDot`
what.d(1): Error: class `what.exception` is forward referenced when looking for
`opDispatch`
what.d(1): Error: class `what.exception` is forward referenced when looking for
`what`
what.d(1): Error: class `what.exception` is forward referenced when looking for
`what`
what.d(1): Error: class `what.exception` is forward referenced when looking for
`what`
what.d(1): Error: class `what.exception` is forward referenced when looking for
`what`
what.d(1): Error: class `what.exception` is forward referenced when looking for
`what`
what.d(1): Error: class `what.exception` is forward referenced when looking for
`at`
what.d(1): Error: class `what.exception` is forward referenced when looking for
`what`
what.d(1): Error: class `what.exception` is forward referenced when looking for
`what`
what.d(1): Error: class `what.exception` is forward referenced when looking for
`what`
what.d(1): Error: class `what.exception` is forward referenced when looking for
`what`
what.d(1): Error: class `what.exception` is forward referenced when looking for
`what`
what.d(1): Error: class `what.exception` is forward referenced when looking for
`what`
what.d(1): Error: class `what.exception` is forward referenced when looking for
`what`
what.d(1): Error: class `what.exception` is forward referenced when looking for
`what`
what.d(1): Error: class `what.exception` is forward referenced when looking for
`what`
what.d(1): Error: class `what.exception` is forward referenced when looking for
`what`
what.d(1): Error: class `what.exception` is forward referenced when looking for
`what`
```

Tested with DMD 2.097.0

--
Jun 20