[Issue 19224] New: core.simd __vector.array "__r2.length cannot be evaluated at compile time"

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Sep 5 14:07:42 UTC 2018


https://issues.dlang.org/show_bug.cgi?id=19224

          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 at puremagic.com
          Reporter: n8sh.secondary at hotmail.com

This may be related to issue #19223 but it might also be a distinct bug.

Example non-compiling code:
https://run.dlang.io/is/zJJlZl

---
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])
"""

--


More information about the Digitalmars-d-bugs mailing list