[Issue 17548] [REG2.072.0] Forward reference error with scope function parameters

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sun Jul 9 16:10:04 PDT 2017


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

--- Comment #5 from github-bugzilla at puremagic.com ---
Commits pushed to stable at https://github.com/dlang/dmd

https://github.com/dlang/dmd/commit/8a67b112405213d95089426b8ecfc598ee14d3fb
Fix Issue 17548 - [REG2.072.0] Forward reference error with scope function
parameters

Prior to this commit, in StructDeclaration.semantic the only two ways the
condition (symtab && !scx && semanticRun < PASSsemanticdone) may be true are:
 - if determineFields() fails
 - if a first semantic() call on the same struct is ongoing

But in the second case, setting semanticRun to PASSsemanticdone is wrong,
because if the semantic() call defers itself, the deferred semantic() call will
return immediately, resulting in a "has forward references" error during
semantic2().

https://github.com/dlang/dmd/commit/b61d20fdbda633d7dfcf18f1b81649f25e32d0c4
Add testcase for issue 17548.

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

https://github.com/dlang/dmd/commit/2f6db2fb8bef57e55a45fc555128bd9d9fbf328e
Merge pull request #6937 from Syniurge/alt-fix17548

Alternative fix to issue 17548 - [REG2.072.0] Forward reference error with
scope function parameters
merged-on-behalf-of: Martin Nowak <code at dawg.eu>

--


More information about the Digitalmars-d-bugs mailing list