www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 6331] New: [CTFE] Cannot evaluate SliceExp on if condition

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6331

           Summary: [CTFE] Cannot evaluate SliceExp on if condition
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: k.hara.pg gmail.com



This code should be compiled, but it generate error.

----
bool func(string s)
{
    if (s[0..1])
        return true;
    return false;
}
enum f = func("str");

void main(){}
----
test.d(7): Error: cannot evaluate func("str") at compile time
----

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 15 2011
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6331


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch



https://github.com/D-Programming-Language/dmd/pull/255

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 16 2011
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6331


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla digitalmars.com
         Resolution|                            |FIXED



14:02:18 PDT ---
https://github.com/D-Programming-Language/dmd/commit/ea9ace3e38ac9c443e5db36c2ea98c984e3e2a89

https://github.com/D-Programming-Language/dmd/commit/0cbb31f3f5117b2bad38fef6c2817476a1c5e165

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 17 2011