--- import std.traits; class C {} void foo(scope C bar = null) {} static assert(ParameterDefaultValueTuple!foo[0] == null); --- For DMD 2.072.0-b1, results in: .../src/phobos/std/traits.d-mixin-1211(1211): Error: scope variable bar may not be returned Works correctly up to 2.071.2
Introduced by https://github.com/dlang/dmd/pull/5903.
And apparently fixed by https://github.com/dlang/dmd/pull/5972
But still a regression in 2.072.0, even if #5972 gets merged for 2.073.0.
Somewhat hacky workaround for ParameterDefaults. https://github.com/dlang/phobos/pull/4864 If more problems w/ the scope checks pop up, we might have to back-off that error.
Commits pushed to stable at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/f783d975a28febea3a323bae3ce5f902cec17aa9 fix Issue 16582 - ParameterDefaults fails w/ scope parameter - workaround scope escape error to get default parameter - would require a working `return scope` for a proper implementation https://github.com/dlang/phobos/commit/e333b7ad4e69b603bc9dfc1cb74593baf43b2193 Merge pull request #4864 from MartinNowak/fix16582 fix Issue 16582 - ParameterDefaults fails w/ scope parameter
Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/f783d975a28febea3a323bae3ce5f902cec17aa9 fix Issue 16582 - ParameterDefaults fails w/ scope parameter https://github.com/dlang/phobos/commit/e333b7ad4e69b603bc9dfc1cb74593baf43b2193 Merge pull request #4864 from MartinNowak/fix16582
Commits pushed to scope at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/f783d975a28febea3a323bae3ce5f902cec17aa9 fix Issue 16582 - ParameterDefaults fails w/ scope parameter https://github.com/dlang/phobos/commit/e333b7ad4e69b603bc9dfc1cb74593baf43b2193 Merge pull request #4864 from MartinNowak/fix16582
Commits pushed to newCTFE at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/f783d975a28febea3a323bae3ce5f902cec17aa9 fix Issue 16582 - ParameterDefaults fails w/ scope parameter https://github.com/dlang/phobos/commit/e333b7ad4e69b603bc9dfc1cb74593baf43b2193 Merge pull request #4864 from MartinNowak/fix16582