Thread overview
[Issue 17548] [REG2.072.0] Forward reference error with scope function parameters
Jun 25, 2017
Vladimir Panteleev
Jun 25, 2017
Elie Morisse
June 25, 2017
https://issues.dlang.org/show_bug.cgi?id=17548

Vladimir Panteleev <dlang-bugzilla@thecybershadow.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dlang-bugzilla@thecybershad
                   |                            |ow.net
            Summary|Forward reference error     |[REG2.072.0] Forward
                   |with scope function         |reference error with scope
                   |parameters                  |function parameters
           Severity|major                       |regression

--- Comment #1 from Vladimir Panteleev <dlang-bugzilla@thecybershadow.net> ---
This seems to be a regression.

Introduced in https://github.com/dlang/dmd/pull/6001

--
June 25, 2017
https://issues.dlang.org/show_bug.cgi?id=17548

johanengelen@weka.io changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |johanengelen@weka.io

--- Comment #2 from johanengelen@weka.io ---
https://github.com/dlang/dmd/pull/6934

--
June 25, 2017
https://issues.dlang.org/show_bug.cgi?id=17548

--- Comment #3 from johanengelen@weka.io ---
Extra testcase by Elie, modifying fwdref2.d to:
```
struct S2 {
    // void bar(int arg = .fwdref1.cnst) {}
    S1 s;
    import fwdref2;
}
```

--
June 25, 2017
https://issues.dlang.org/show_bug.cgi?id=17548

--- Comment #4 from Elie Morisse <syniurge@gmail.com> ---
https://github.com/dlang/dmd/pull/6937/

--
July 09, 2017
https://issues.dlang.org/show_bug.cgi?id=17548

--- Comment #5 from github-bugzilla@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@dawg.eu>

--
July 09, 2017
https://issues.dlang.org/show_bug.cgi?id=17548

github-bugzilla@puremagic.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--
July 10, 2017
https://issues.dlang.org/show_bug.cgi?id=17548

--- Comment #6 from github-bugzilla@puremagic.com ---
Commits pushed to master 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

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

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

--
August 07, 2017
https://issues.dlang.org/show_bug.cgi?id=17548

--- Comment #7 from github-bugzilla@puremagic.com ---
Commits pushed to newCTFE 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

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

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

--