www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 23091] New: importC: string literals no longer convert to D


          Issue ID: 23091
           Summary: importC: string literals no longer convert to D string
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: ImportC
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: duser neet.fi
                CC: duser neet.fi

// dmodule.d
void d_fn(string s){}
string d_var;
// test.c
__import dmodule;
void fn()
        d_var = "b";

test.c(4): Error: function `dmodule.d_fn(string s)` is not callable using
argument types `(char*)`
test.c(4):        cannot pass argument `"a"` of type `char*` to parameter
`string s`
test.c(5): Error: cannot implicitly convert expression `"b"` of type `char*` to

this worked before https://github.com/dlang/dmd/pull/14027

May 05 2022