Skip to content

Commit

Permalink
Merge pull request #7298 from JinShil/fix16183
Browse files Browse the repository at this point in the history
Fix Issue 16183 - [REG2.068] compile-time string concatenation fails …
merged-on-behalf-of: Walter Bright <WalterBright@users.noreply.github.com>
  • Loading branch information
dlang-bot committed Nov 11, 2017
2 parents 9b86ddd + 4ae9018 commit 12964b3
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
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
@@ -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 12964b3

Please sign in to comment.