Bug 17192 – ParameterDefaults fails when parameter is called "i"

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2017-02-17T01:25:54Z
Last change time
2018-01-05T13:30:59Z
Keywords
pull
Assigned to
ag0aep6g
Creator
John Colvin

Comments

Comment #0 by john.loughran.colvin — 2017-02-17T01:25:54Z
import std.traits; struct Base { void foo(int i) {} } alias blah = ParameterDefaults!(Base.foo); std/traits.d(1227): Error: variable i cannot be read at compile time std/traits.d(1228): Error: variable i cannot be read at compile time std/traits.d(1252): Error: template instance std.traits.ParameterDefaults!(foo).Get!0LU error instantiating std/traits.d(1255): instantiated from here: Impl!0LU test.d(8): instantiated from here: ParameterDefaults!(foo) bisection isn't totally certain yet, but I'm 90% sure it was caused by this: https://github.com/dlang/phobos/pull/4889/commits/f783d975a28febea3a323bae3ce5f902cec17aa9
Comment #1 by ag0aep6g — 2017-08-02T20:32:46Z
It fails because ParameterDefaults uses the name "i" internally, but it gets hijacked by the parameter. https://github.com/dlang/phobos/pull/5671
Comment #2 by github-bugzilla — 2017-08-07T13:43:18Z
Commits pushed to stable at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/2e063e92469bcbda9171ba6dea45a3c158810ae6 fix issue 17192 - ParameterDefaults fails when parameter is called "i" https://github.com/dlang/phobos/commit/5d3c842dfe84a9bfb8bd617b11f8d23175570094 Merge pull request #5671 from aG0aep6G/ParameterDefaults fix issue 17192 - ParameterDefaults fails when parameter is called "i" merged-on-behalf-of: Martin Nowak <[email protected]>
Comment #3 by github-bugzilla — 2017-08-16T13:13:53Z
Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/2e063e92469bcbda9171ba6dea45a3c158810ae6 fix issue 17192 - ParameterDefaults fails when parameter is called "i" https://github.com/dlang/phobos/commit/5d3c842dfe84a9bfb8bd617b11f8d23175570094 Merge pull request #5671 from aG0aep6G/ParameterDefaults
Comment #4 by github-bugzilla — 2018-01-05T13:30:59Z
Commits pushed to dmd-cxx at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/2e063e92469bcbda9171ba6dea45a3c158810ae6 fix issue 17192 - ParameterDefaults fails when parameter is called "i" https://github.com/dlang/phobos/commit/5d3c842dfe84a9bfb8bd617b11f8d23175570094 Merge pull request #5671 from aG0aep6G/ParameterDefaults