www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 16183] New: compile-time string concatenation fails with CTFE

https://issues.dlang.org/show_bug.cgi?id=16183

          Issue ID: 16183
           Summary: compile-time string concatenation fails with CTFE and
                    char[] literal involved
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: ag0aep6g gmail.com

This is a further reduction of issue 16182. Filing this as a separate issue,
because issue 16182 is a phobos issue that can be fixed by working around the
compiler bug here.

----
string f() { return ['f']; }
string g(string s) { return s; }
enum string x = f();
enum string y = x ~ '.' ~ g("g"); /* Error: cannot implicitly convert
expression ("f.g") of type char[] to string */
----

--
Jun 18 2016