[Issue 6331] New: [CTFE] Cannot evaluate SliceExp on if condition
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Jul 15 23:18:36 PDT 2011
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 at puremagic.com
ReportedBy: k.hara.pg at gmail.com
--- Comment #0 from Kenji Hara <k.hara.pg at gmail.com> 2011-07-15 23:13:22 PDT ---
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: -------
More information about the Digitalmars-d-bugs
mailing list