[Issue 23230] New: cannot implicitly convert expression `"define"` of type `char[7]` to `char`

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jul 5 23:33:16 UTC 2022


https://issues.dlang.org/show_bug.cgi?id=23230

          Issue ID: 23230
           Summary: cannot implicitly convert expression `"define"` of
                    type `char[7]` to `char`
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: dave287091 at gmail.com

>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).

--


More information about the Digitalmars-d-bugs mailing list