[Issue 18939] New: Wrong order slice lengths in array length mismatch error message

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Jun 3 18:22:13 UTC 2018


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

          Issue ID: 18939
           Summary: Wrong order slice lengths in array length mismatch
                    error message
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: luis at luismarques.eu

I was confused by this message:

    a[x..y] = b[];
    object.Error@(0): Array lengths don't match for copy: 3932160 != 1310720

I looked around wondering how the heck x..y had become 3932160, only to realize
that the order of "3932160 != 1310720" doesn't match the order of a[] = b[],
it's the other way around.

It seems to me like printing the lengths in the same order as the source code
assignment would make more intuitive sense.

--


More information about the Digitalmars-d-bugs mailing list