Bug 18346 – implicit conversion from int to char in `"foo" ~ 255` should be illegal

Status
RESOLVED
Resolution
DUPLICATE
Severity
major
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Mac OS X
Creation time
2018-02-01T06:11:46Z
Last change time
2018-02-06T04:02:13Z
Assigned to
No Owner
Creator
Timothee Cour

Comments

Comment #0 by timothee.cour2 — 2018-02-01T06:11:46Z
string a="foo" ~ 255; // compiles but should not (too easy to confuse with "foo"~"255" as in other languages, when instead it means append char(255)) string a="foo" ~ 256; Error: incompatible types for (("foo") ~ (256)): 'string' and 'int' instead: we should write: ``` string a="foo" ~ char(255); ```
Comment #1 by schveiguy — 2018-02-06T04:02:13Z
*** This issue has been marked as a duplicate of issue 14035 ***