digitalmars.D.bugs - [Issue 6280] New: [CTFE] Cannot put 'in' expression of AA in an 'if' condition
- d-bugmail puremagic.com (43/43) Jul 10 2011 http://d.puremagic.com/issues/show_bug.cgi?id=6280
- d-bugmail puremagic.com (6/6) Jul 10 2011 http://d.puremagic.com/issues/show_bug.cgi?id=6280
- d-bugmail puremagic.com (13/13) Jul 26 2011 http://d.puremagic.com/issues/show_bug.cgi?id=6280
http://d.puremagic.com/issues/show_bug.cgi?id=6280
Summary: [CTFE] Cannot put 'in' expression of AA in an 'if'
condition
Product: D
Version: D2
Platform: Other
OS/Version: All
Status: NEW
Keywords: rejects-valid
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody puremagic.com
ReportedBy: kennytm gmail.com
Test case:
--------------------------------
static assert({
if (0 in [0:0]) {}
return true;
}());
--------------------------------
x.d(4): Error: cannot evaluate delegate pure nothrow bool()
{
if (0 in [0:0])
{
}
return true;
}
() at compile time
x.d(1): Error: static assert (delegate pure nothrow bool()
{
if (0 in [0:0])
{
}
return true;
}
()) is not evaluatable at compile time
--------------------------------
Calling 'if((a in b) !is null)' can workaround the problem.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 10 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6280 The problem is there isn't an IndexExp::isBool. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jul 10 2011
http://d.puremagic.com/issues/show_bug.cgi?id=6280
Walter Bright <bugzilla digitalmars.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
CC| |bugzilla digitalmars.com
Resolution| |FIXED
15:18:16 PDT ---
https://github.com/D-Programming-Language/dmd/commit/0904c8aa200e4d080d500d96d5904c33ba17cc86
https://github.com/D-Programming-Language/dmd/commit/e48a8c67f02172c72e04f36759d2d6868d716368
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 26 2011









d-bugmail puremagic.com 