Thread overview
[Issue 9017] New: __traits(compiles, { enum e = <expression tuple>; }) is true but code doesn't compile
Nov 13, 2012
Denis Shelomovskij
Aug 11, 2013
Kenji Hara
Aug 12, 2013
Kenji Hara
Aug 18, 2013
Walter Bright
November 13, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=9017

           Summary: __traits(compiles, { enum e = <expression tuple>; })
                    is true but code doesn't compile
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: verylonglogin.reg@gmail.com


--- Comment #0 from Denis Shelomovskij <verylonglogin.reg@gmail.com> 2012-11-13 10:27:10 MSK ---
---
template X(Args...)
{
    static if(__traits(compiles, { enum e = Args; }))
        enum e = Args;
}
alias X!0 X0; // line 7
---

Output:
---
main.d(7): Error: cannot cast int to (int)
main.d(7): Error: template instance main.X!(0) error instantiating
---

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
August 11, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9017


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull


--- Comment #1 from Kenji Hara <k.hara.pg@gmail.com> 2013-08-11 04:41:51 PDT ---
https://github.com/D-Programming-Language/dmd/pull/2464

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
August 12, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9017


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |2krnk@gmx.net


--- Comment #2 from Kenji Hara <k.hara.pg@gmail.com> 2013-08-12 07:54:24 PDT ---
*** Issue 10803 has been marked as a duplicate of this issue. ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
August 18, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9017



--- Comment #3 from github-bugzilla@puremagic.com 2013-08-17 23:31:45 PDT ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/435af3171f488c7857c2d2859c1c99981de19506
fix Issue 9017 - __traits(compiles, { enum e = <expression tuple>; }) is true
but code doesn't compile

https://github.com/D-Programming-Language/dmd/commit/558fffad139416b48eb05a58be05b6c7e2364519 Merge pull request #2464 from 9rnsr/fix9017

Issue 9017 - __traits(compiles, { enum e = <expression tuple>; }) is true but
code doesn't compile

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
August 18, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9017


Walter Bright <bugzilla@digitalmars.com> changed:

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


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