Skip to content

Commit

Permalink
Fix Issue 16183 - [REG2.068] compile-time string concatenation fails …
Browse files Browse the repository at this point in the history
…with CTFE and char[] literal involved
  • Loading branch information
JinShil committed Nov 10, 2017
1 parent d0e63c8 commit 4ae9018
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ddmd/dcast.d
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,8 @@ extern (C++) MATCH implicitConvTo(Expression e, Type t)
MATCH m = MATCH.exact;
if (e.type.nextOf().mod != tn.mod)
{
if (!tn.isConst())
// https://issues.dlang.org/show_bug.cgi?id=16183
if (!tn.isConst() && !tn.isImmutable())
return;
m = MATCH.constant;
}
Expand Down
7 changes: 7 additions & 0 deletions test/compilable/test16183.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// https://issues.dlang.org/show_bug.cgi?id=16183

void main()
{
const string g(const string s) { return s; }
enum string y = ['f'] ~ g("g");
}

0 comments on commit 4ae9018

Please sign in to comment.