D issues are now
tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Summary: |
[CTFE] Cannot evaluate SliceExp on if condition |
Product: |
D
|
Reporter: |
Kenji Hara <k.hara.pg> |
Component: |
dmd | Assignee: |
No Owner <nobody> |
Status: |
RESOLVED
FIXED
|
Severity: |
normal
|
CC: |
bugzilla
|
Priority: |
P2
|
Keywords: |
patch, rejects-valid |
Version: |
D2 |
Hardware: |
x86_64 |
OS: |
Windows |
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
----