Given
char x[];
why is
typeof("a" ~ x)
`char[]` when
typeof("a" ~ x.idup)
is
`string`?
My case is
class NameLookupException : Exception
{
this(string name) {
super("Name " ~ name ~ " could not be found");
}
this(scope const(char)[] name) {
super("Name " ~ name.idup ~ " could not be found");
}
}
where I instead would like to only need
class NameLookupException : Exception
{
this(scope const(char)[] name) {
super("Name " ~ name ~ " could not be found");
}
}
Why isn't
"Name " ~ name ~ " could not be found"
implicitly convertible to `string`?
Would
class NameLookupException : Exception
{
this(scope const(char)[] name) @trusted {
super("Name " ~ cast(string)name ~ " could not be found");
}
}
be ok?