Summary: Tuples conversion assign
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: enhancement
          Priority: P2
         Component: Phobos

--- Comment #0 from 2012-01-11 19:55:45 PST ---
Currently D tuples are library defined, and this probably gives some small

But I think well implemented built-in tuples should allow code like this,
because here we are assigning an immutable value and copying it to a mutable

import std.typecons: Tuple, tuple;
Tuple!(int) foo() {
    immutable int x = 1;
    return tuple(x);
void main() {}

DMD 2.058head:
test.d(4): Error: cannot implicitly convert expression (tuple(1)) of type
Tuple!(immutable(int)) to Tuple!(int)

Because this code is allowed, and tuples too are values:

int foo() {
    immutable int x = 1;
    return x;
void main() {}

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to