Bug 7053 – inout implicit conversion error

Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2011-12-02T10:36:00Z
Last change time
2013-06-07T01:46:36Z
Assigned to
nobody
Creator
wfunction

Comments

Comment #0 by wfunction — 2011-12-02T10:36:23Z
inout() should NOT be treated as a type constructor, which changes the return type: class C(T) { inout this(inout(T)) { } } C!T slice(T)(auto ref T c) { return new C!T(c); } void main() { [1, 2, 3, 4, 5].slice(); } //Test.d(2): Error: cannot implicitly convert expression (new C(items))
Comment #1 by maximzms — 2013-06-07T01:46:36Z