[Issue 14351] New: `inout` base class constructor can't be called
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Fri Mar 27 11:52:01 PDT 2015
https://issues.dlang.org/show_bug.cgi?id=14351
Issue ID: 14351
Summary: `inout` base class constructor can't be called
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Keywords: rejects-valid
Severity: normal
Priority: P1
Component: DMD
Assignee: nobody at puremagic.com
Reporter: verylonglogin.reg at gmail.com
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
---
--
More information about the Digitalmars-d-bugs
mailing list