Bug 14351 – [REG2.063] `inout` base class constructor can't be called

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-03-27T18:52:00Z
Last change time
2015-06-17T21:05:36Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
verylonglogin.reg

Comments

Comment #0 by verylonglogin.reg — 2015-03-27T18:52:01Z
This code should compile fine: --- class B { this(inout int[]) inout { } } class D1: B { this(int[] arr) { super(arr); } } class D2: B { this(const int[] arr) const { super(arr); } } class D3: B { this(inout int[] arr) inout { super(arr); } } --- main.d(8): Error: inout constructor main.B.this creates mutable object, not mutable main.d(13): Error: inout constructor main.B.this creates const object, not const main.d(18): Error: inout constructor main.B.this creates inout object, not inout ---
Comment #1 by dlang-bugzilla — 2015-03-30T18:53:18Z
This compiled in 2.062, and was broken by this pull request: https://github.com/D-Programming-Language/dmd/pull/1726
Comment #2 by temtaime — 2015-04-22T20:25:25Z
What is purpose of inout ctors ? In such example you could declare only ctor with « const int » - so int implicitly converts to const. Maybe most of attributes(const, inout, ...) on ctors should be forbidden ?
Comment #3 by k.hara.pg — 2015-06-01T11:39:26Z
Comment #4 by github-bugzilla — 2015-06-01T16:42:32Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/e4fd82893f9b2f7ff1bc1580ea5553a2752be9df fix Issue 14351 - `inout` base class constructor can't be called https://github.com/D-Programming-Language/dmd/commit/e801243f6e20fc7dd8a24100433878662e906b17 Merge pull request #4705 from 9rnsr/fix14351 [REG2.063] Issue 14351 - `inout` base class constructor can't be called
Comment #5 by github-bugzilla — 2015-06-17T21:05:36Z