[Issue 14035] New: string concatenation accepts ints in templates
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Fri Jan 23 13:16:16 PST 2015
https://issues.dlang.org/show_bug.cgi?id=14035
Issue ID: 14035
Summary: string concatenation accepts ints in templates
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: minor
Priority: P1
Component: DMD
Assignee: nobody at puremagic.com
Reporter: ketmar at ketmar.no-ip.org
the following code happily compiles:
template alice (usize ln=__LINE__) {
enum alice = "{ int t_"~ln~" = 42; }";
}
pragma(msg, alice!());
it uses `ln` value as character code, which seems to be wrong, as trying to do
the same in ordinary function fails with the following message:
Error: incompatible types for (("{ int t_") ~ (ln)): 'string' and 'uint'
--
More information about the Digitalmars-d-bugs
mailing list