[Issue 9089] New: Very restrictive Tuple constructor

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Nov 27 19:26:39 PST 2012


http://d.puremagic.com/issues/show_bug.cgi?id=9089

           Summary: Very restrictive Tuple constructor
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: bearophile_hugs at eml.cc


--- Comment #0 from bearophile_hugs at eml.cc 2012-11-27 19:26:38 PST ---
Is it possible for the Tuple constructors to have value range analysis and
accept code like this?


import std.typecons: Tuple;
alias T = Tuple!(short);
void main() {
    short x = 1; // OK
    T t = T(1); // error
}


Currently in DMD 2.061alpha it gives:

...\dmd2\src\phobos\std\typecons.d(406): Error: cannot implicitly convert
expression (_param_0) of type int to short
test.d(5): Error: template instance
std.typecons.Tuple!(short).Tuple.__ctor!(int) error instantiating

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list