[Issue 14987] Internal error: backend/cod1.c 1711
    via Digitalmars-d-bugs 
    digitalmars-d-bugs at puremagic.com
       
    Mon Aug 31 09:51:04 PDT 2015
    
    
  
https://issues.dlang.org/show_bug.cgi?id=14987
Luís Marques <luis at luismarques.eu> changed:
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |luis at luismarques.eu
--- Comment #1 from Luís Marques <luis at luismarques.eu> ---
rswhite4, although the compiler error should be fixed, I don't think this code
was going to work anyway. size_t[4] and size_t[5] are different types, and
`auto dim(size_t dim);` is not a template, so you would not be able to return
one or the other from the same function.
Did you mean to write something like this?
    import std.range : repeat, take, array;
    auto dim(size_t n)()
    {
        size_t[n] a = n.repeat.take(n).array;
        return a;
    }
    void main()
    {
        auto arr1 = dim!4;    
    }
--
    
    
More information about the Digitalmars-d-bugs
mailing list