Bug 6331 – [CTFE] Cannot evaluate SliceExp on if condition
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Windows
Creation time
2011-07-15T23:13:00Z
Last change time
2011-07-17T14:02:18Z
Keywords
patch, rejects-valid
Assigned to
nobody
Creator
k.hara.pg
Comments
Comment #0 by k.hara.pg — 2011-07-15T23:13:22Z
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
----