Bug 23413 – Array __equals lowering fails to infer @safe with cryptic error

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2022-10-14T14:02:23Z
Last change time
2024-12-13T19:24:59Z
Keywords
diagnostic
Assigned to
No Owner
Creator
Dennis
Moved to GitHub: dmd#20164 →

Comments

Comment #0 by dkorpel — 2022-10-14T14:02:23Z
``` @safe: struct T { S s; } struct S { S[] s; T[] t; } void main() { assert(S.init == S.init); } ``` Error: incompatible types for array comparison: `S[]` and `S[]` Error: incompatible types for array comparison: `T[]` and `T[]` I think what's happening here is that `@safe` inference fails because of a cyclic dependency (issue 7205), and the compiler gives a generic error when lowering to `__equals` fails, which completely misses the mark.
Comment #1 by robert.schadek — 2024-12-13T19:24:59Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/20164 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB