D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 7109 - [CTFE] Error with slicing ref string
Summary: [CTFE] Error with slicing ref string
Status: RESOLVED DUPLICATE of issue 6934
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Windows
: P2 normal
Assignee: No Owner
URL:
Keywords: wrong-code
Depends on:
Blocks:
 
Reported: 2011-12-14 05:15 UTC by Hisayuki Mima
Modified: 2011-12-14 23:04 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 Hisayuki Mima 2011-12-14 05:15:34 UTC
struct Struct{
    string str;
}

void bar(ref string str){
    str = str[0..0];
}

static assert({
    auto s = Struct("foo");
    bar(s.str);
    return true;
}());


This code does't work.
Comment 1 Don 2011-12-14 07:38:42 UTC
Related to bug 6934.

It's fixed in this two-week old pull request:
https://github.com/D-Programming-Language/dmd/pull/522
Comment 2 Don 2011-12-14 23:04:33 UTC

*** This issue has been marked as a duplicate of issue 6934 ***