[Issue 22082] New: static float array comparison not available in betterC
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Jun 24 14:32:53 UTC 2021
https://issues.dlang.org/show_bug.cgi?id=22082
Issue ID: 22082
Summary: static float array comparison not available in betterC
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Keywords: betterC
Severity: normal
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: dkorpel at live.nl
Array comparisons either:
- directly generate memcmp code (integral types) in e2ir.d
- call _adEq2 from druntime which uses TypeInfo
- are lowered to object.__equals in expressionsem.d
Comparing `float` arrays works in betterC through object.__equals, but when
both arguments are static arrays, the lowering doesn't happen:
```
// compile with -betterC
void main() {
float[3] a, b;
const x = a[] == b; // fine
const y = a == b; // Error: `TypeInfo` cannot be used with -betterC
}
```
--
More information about the Digitalmars-d-bugs
mailing list