Bug 11966 – Regression 2.065.b1: inout(const(char))[] doesn't convert to inout(char)[]

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-01-22T03:55:00Z
Last change time
2014-01-23T04:15:47Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
doob

Comments

Comment #0 by doob — 2014-01-22T03:55:12Z
The following code used to work with 2.064.2: inout(char)[] stripped (inout(char)[] path) { return path; } struct PathParser { inout(const(char))[] pop () inout { return stripped (path); } inout(const(char))[] path () inout { return null; } } void main () { auto a = PathParser().pop; } With 2.065.b1 it results in this error: Error: function main.stripped (inout(char)[] path) is not callable using argument types (inout(const(char))[])
Comment #1 by k.hara.pg — 2014-01-22T06:26:09Z
https://github.com/D-Programming-Language/dmd/pull/3138 'inout const' type qualifier is introduced by fixing issue 6930, but its first implementation had not been perfect.
Comment #2 by bugzilla — 2014-01-23T01:45:33Z
(In reply to comment #1) > https://github.com/D-Programming-Language/dmd/pull/3138 > > 'inout const' type qualifier is introduced by fixing issue 6930, but its first > implementation had not been perfect. what does 'inout const' mean?
Comment #3 by k.hara.pg — 2014-01-23T02:09:13Z
(In reply to comment #2) > (In reply to comment #1) > > https://github.com/D-Programming-Language/dmd/pull/3138 > > > > 'inout const' type qualifier is introduced by fixing issue 6930, but its first > > implementation had not been perfect. > > what does 'inout const' mean? - A common type qualifier between immutable and inout - If inout function returns inout(const(T)), it will be deduced to const(T), immutable(T), or inout(const(T)). Different from inout(T), it won't be deduced to T because 'const' sticks.
Comment #4 by github-bugzilla — 2014-01-23T03:37:27Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/f09add4eff88889dc95d38a336bab6d6f168b1a6 fix Issue 11966 - inout(const(char))[] doesn't convert to inout(char)[] https://github.com/D-Programming-Language/dmd/commit/b8c39d2f4dae658efa26476e94fdb7eb17f3cbc4 Merge pull request #3138 from 9rnsr/fix11966 [REG2.065a] Issue 11966 - inout(const(char))[] doesn't convert to inout(char)[]
Comment #5 by github-bugzilla — 2014-01-23T04:15:47Z
Commit pushed to release at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/2b9da972dd8007a33d0cf07cfdfa18d1a9df3223 Merge pull request #3138 from 9rnsr/fix11966 [REG2.065a] Issue 11966 - inout(const(char))[] doesn't convert to inout(char)[]