Bug 23230 – cannot implicitly convert expression define of type char[7] to char

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2022-07-05T23:33:16Z
Last change time
2022-09-15T09:33:52Z
Keywords
ImportC
Assigned to
No Owner
Creator
dave287091

Comments

Comment #0 by dave287091 — 2022-07-05T23:33:16Z
From https://briancallahan.net/blog/20220704.html #define NUMSCHKEYS 4 #define MAXLENSCHKEYS 17 /* 17 = longest keyword (16) + 1 */ char scharkey[NUMSCHKEYS][MAXLENSCHKEYS] = { "define", "list", "if", "lambda" }; generates the error for each string literal: cannot implicitly convert expression `"define"` of type `char[7]` to `char` (or similar message).
Comment #1 by dlang-bot — 2022-09-15T09:33:52Z
dlang/dmd pull request #14436 "fix Issue 23230 - cannot implicitly convert expression define of type…" was merged into master: - b8e0da418c1881e84336b0ce764c8f7be85168e8 by Walter Bright: fix Issue 23230 - cannot implicitly convert expression define of type char[7] to char https://github.com/dlang/dmd/pull/14436