[Issue 24235] New: Functions 0-out single element static arrays
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Nov 8 20:07:45 UTC 2023
https://issues.dlang.org/show_bug.cgi?id=24235
Issue ID: 24235
Summary: Functions 0-out single element static arrays
Product: D
Version: D2
Hardware: x86
OS: Windows
Status: NEW
Severity: enhancement
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: isaacbunsen at gmail.com
when passing a single element static array of float[1] or double[1] that
accepts multiple arguments, one will find that the argument is 0 when the
function is called. For example, the following code fails the assert. `a` is an
array of [0] no matter what is passed in. This does no happen if the second
argument is removed, or the length of the array is increased.
float test(float[1] a, float whatever) {
return a[0];
}
unittest {
assert(test([1.0], 1) == 1);
}
--
More information about the Digitalmars-d-bugs
mailing list