Summary: [CTFE] Strange behavior of assignment appears in a
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD

--- Comment #0 from Hisayuki Mima <> 2011-05-16 00:45:47 PDT 
struct Foo{
    string field;

bool func(string input){
    Foo foo;
    foo.field = input[0..$];
    assert(foo.field == "test");
    foo.field = "test2";//assignment1
    assert(foo.field == "test");//assertion1
    assert(foo.field == "test2");//assertion2
    return true;

static assert(func("test"));

This code doesn't work on dmd v2.053.
Somehow assertion1 succeeds and somehow assertion2 fails in CTFE.
This shows that assignment1 has wrong behavior.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to