[Issue 10778] New: Can't define a std.typecons.Typedef of a significant 2D matrix

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Aug 8 07:42:08 PDT 2013


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

           Summary: Can't define a std.typecons.Typedef of a significant
                    2D matrix
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: bearophile_hugs at eml.cc


--- Comment #0 from bearophile_hugs at eml.cc 2013-08-08 07:42:07 PDT ---
import std.typecons: Typedef;
alias Matrix = double[260][260];
alias Foo = Typedef!Matrix;
void main() {}



dmd 2.064alpha gives:

test.d(3): Error: template instance std.typecons.Typedef!(double[360u][260u])
recursive expansion


My main use case for Typedef is with arrays, to tell them apart, to avoid bugs.


This used to work correctly:

alias Matrix = double[260][260];
typedef Matrix Foo;
void main() {
    Foo m;
}

-- 
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