http://d.puremagic.com/issues/show_bug.cgi?id=6336
Summary: Can't return ref T where T has const/immutable members
Product: D
Version: D2
Platform: Other
OS/Version: Windows
Status: NEW
Severity: major
Priority: P2
Component: DMD
AssignedTo: [email protected]
ReportedBy: [email protected]
--- Comment #0 from Denis <[email protected]> 2011-07-16 08:19:56 PDT
---
As a result "front" and "back" template functions from std.array don't compile,
isInputRange!(S[]) is false and none of range functions can work with an array
of structs with a const/immutable member.
immutable struct IS { int t; }
struct S { immutable int t; }
void f(ref S) { } //compiles
ref IS f() { return IS(); } //compiles too
ref S f() { return S(); } //doesn't compile
void main() {
static assert( isInputRange!(S[]) ); //as a result assertion failure
}
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------