[Issue 23091] New: importC: string literals no longer convert to D string type
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu May 5 10:27:19 UTC 2022
https://issues.dlang.org/show_bug.cgi?id=23091
Issue ID: 23091
Summary: importC: string literals no longer convert to D string
type
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Keywords: ImportC
Severity: normal
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: duser at neet.fi
CC: duser at neet.fi
// dmodule.d
void d_fn(string s){}
string d_var;
// test.c
__import dmodule;
void fn()
{
d_fn("a");
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
`string`
this worked before https://github.com/dlang/dmd/pull/14027
--
More information about the Digitalmars-d-bugs
mailing list