Bug 9984 – inout qualifier is skipped for constructor arguments (template constructor only)

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-04-23T09:21:00Z
Last change time
2013-04-23T19:44:20Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
maximzms

Comments

Comment #0 by maximzms — 2013-04-23T09:21:55Z
The following code does not compile: -------------------- struct Foo { int[] p; inout this()(inout int[] a) // test.d(5) { p = a; } auto foo() inout { return inout(Foo)(p); // test.d(12) } } void main() {} -------------------- test.d(12): Error: template test.Foo.__ctor does not match any function template declaration. Candidates are: test.d(5): test.Foo.__ctor()(int[] a) test.d(12): Error: template test.Foo.__ctor()(int[] a) cannot deduce template function from argument types !()(inout(int[])) inout -------------------- There is no error if constructor is function not template
Comment #1 by maximzms — 2013-04-23T09:41:33Z
Comment #2 by k.hara.pg — 2013-04-23T18:42:46Z
This is a regression occured in 2.063alpha. https://github.com/D-Programming-Language/dmd/pull/1927
Comment #3 by github-bugzilla — 2013-04-23T19:39:17Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/1c3c2b3a53382cd9408ad741daa8b64566bcb22f fix Issue 9984 - inout qualifier is skipped for constructor arguments (template constructor only) https://github.com/D-Programming-Language/dmd/commit/488b6f343b5d69d4e7aff181a29b82712b19bbca Merge pull request #1927 from 9rnsr/fix9984 [REG2.063a] Issue 9984 - inout qualifier is skipped for constructor arguments (template constructor only)