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