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
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