Bug 2786 – Interfaces should be able to require constructors

Status
RESOLVED
Resolution
INVALID
Severity
enhancement
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Linux
Creation time
2009-04-02T12:59:00Z
Last change time
2015-06-09T05:14:43Z
Assigned to
nobody
Creator
andrei

Comments

Comment #0 by andrei — 2009-04-02T12:59:17Z
This should work: interface Foo { this(); // default construction is enabled this(this); // copy construction is enabled this(int); // construction from an int } Copy construction does not make sense for classes, but will make for struct once struct inheritance of interfaces will be defined.
Comment #1 by andrei — 2009-08-27T14:29:53Z
I'm dropping this because introspection seems to be a better path to achieving such requirements.