Bug 23674 – incompatible types for array comparison: string and string
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2023-02-06T23:54:12Z
Last change time
2023-02-13T03:29:14Z
Keywords
pull
Assigned to
No Owner
Creator
JR
Comments
Comment #0 by zorael — 2023-02-06T23:54:12Z
Manjaro/Arch x86_64, dmd 2.102.0 fetched with install.sh.
Unhelpful error message when comparing an out-of-bounds element of an array with a value of the same element type.
---
void main()
{
string[2] arr;
assert(arr[2] == string.init);
}
---
onlineapp.d(4): Error: incompatible types for array comparison: `string` and `string`
Comment #1 by razvan.nitu1305 — 2023-02-08T12:14:29Z
This is a 2.094 regression.
Comment #2 by dlang-bot — 2023-02-08T14:19:59Z
@RazvanN7 created dlang/dmd pull request #14868 "Fix Issue 23674 - incompatible types for array comparison: string and string" fixing this issue:
- Fix Issue 23674 - incompatible types for array comparison: string and string
https://github.com/dlang/dmd/pull/14868
Comment #3 by dlang-bot — 2023-02-10T13:01:27Z
dlang/dmd pull request #14868 "Fix Issue 23674 - incompatible types for array comparison: string and string" was merged into stable:
- 3c6913212806e73738e8d26d44ac92c26f70287b by RazvanN7:
Fix Issue 23674 - incompatible types for array comparison: string and string
https://github.com/dlang/dmd/pull/14868
Comment #4 by dlang-bot — 2023-02-13T03:29:14Z
dlang/dmd pull request #14875 "merge stable" was merged into master:
- 4463cfd129a480c0d758276db10135acb0c55e28 by Razvan Nitu:
Fix Issue 23674 - incompatible types for array comparison: string and string (#14868)
https://github.com/dlang/dmd/pull/14875