Bug 22054 – Referencing a fwd-declared field results in many error messages

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2021-06-21T03:43:55Z
Last change time
2021-07-08T10:04:14Z
Keywords
pull
Assigned to
No Owner
Creator
Mathias LANG

Comments

Comment #0 by pro.mathias.lang — 2021-06-21T03:43:55Z
``` 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
Comment #1 by moonlightsentinel — 2021-06-21T10:52:35Z
Output before 2.071.2: onlineapp.d(1): Error: class onlineapp.exception is forward referenced when looking for 'what' onlineapp.d(5): Error: no property 'what' for type 'onlineapp.exception'
Comment #2 by dlang-bot — 2021-07-02T13:03:32Z
@RazvanN7 created dlang/dmd pull request #12801 "Fix Issue 22054 - Referencing a fwd-declared field results in many er" fixing this issue: - Fix Issue 22054 - Referencing a fwd-declared field results in many error messages https://github.com/dlang/dmd/pull/12801
Comment #3 by dlang-bot — 2021-07-08T10:04:14Z
dlang/dmd pull request #12801 "Fix Issue 22054 - Referencing a fwd-declared field results in many error messages" was merged into master: - b03ae923ab8ffdd25d24365b3ea922dacc05a38c by RazvanN7: Fix Issue 22054 - Referencing a fwd-declared field results in many error messages https://github.com/dlang/dmd/pull/12801