Bug 16582 – [REG2.072.0-b1] ParamterDefaultValueTuple fails to compile for scope paramters

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-10-03T17:11:00Z
Last change time
2017-01-16T23:24:14Z
Keywords
pull
Assigned to
nobody
Creator
sludwig

Comments

Comment #0 by sludwig — 2016-10-03T17:11:30Z
--- 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
Comment #1 by code — 2016-10-15T16:27:50Z
Comment #2 by bugzilla — 2016-10-15T21:44:57Z
Comment #3 by sludwig — 2016-10-16T09:26:16Z
But still a regression in 2.072.0, even if #5972 gets merged for 2.073.0.
Comment #4 by code — 2016-10-16T12:23:47Z
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.
Comment #5 by github-bugzilla — 2016-10-17T18:51:07Z
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
Comment #6 by github-bugzilla — 2016-11-20T23:19:13Z
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
Comment #7 by github-bugzilla — 2016-12-27T13:11:04Z
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
Comment #8 by github-bugzilla — 2017-01-16T23:24:14Z
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