D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 6435 - Regression (2.054) Cannot append to a string member of a struct in CTFE
Summary: Regression (2.054) Cannot append to a string member of a struct in CTFE
Status: RESOLVED DUPLICATE of issue 6276
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: Other Linux
: P2 regression
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-08-03 11:19 UTC by Max Samukha
Modified: 2011-08-04 07:35 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Max Samukha 2011-08-03 11:19:10 UTC
struct S
{
    string bar;
}

int foo()
{
    S s;
    s.bar = "one"; // compiles if this is commented out
    s.bar ~= "two";
    return 0;
}

auto x = foo();

void main()
{       
}

Error: s.bar ~= "two" cannot be evaluated at compile time
Comment 1 Don 2011-08-04 05:26:53 UTC
This has already been fixed in git.

*** This issue has been marked as a duplicate of issue 6276 ***
Comment 2 Max Samukha 2011-08-04 07:35:26 UTC
Great, thanks!