www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 19224] New: core.simd __vector.array "__r2.length cannot be


          Issue ID: 19224
           Summary: core.simd __vector.array "__r2.length cannot be
                    evaluated at compile time"
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: n8sh.secondary hotmail.com

Example non-compiling code:

float sum(const float[4] val)
    float sum = 0;
    foreach (x; val) sum += x;
    return sum;

void main()
    import core.simd : float4;
    enum x = sum(float4.init.array);

Error message:
Error: __r2.length cannot be evaluated at compile time"
onlineapp.d(11): called from here: sum(cast(__vector(float[4]))[nanF, nanF,
nanF, nanF])

Sep 05 2018