www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 8234] New: symbols used in CTFE affect the function literal type

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8234

           Summary: symbols used in CTFE affect the function literal type
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: timon.gehr gmx.ch



DMD 2.059:

void foo(){
    immutable int x = 0;
    static assert(is(typeof(*(){enum e=x;return e;})==function)); // fail
}

The static assertion should pass.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 13 2012
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=8234


Don <clugdbug yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |clugdbug yahoo.com.au



This is not a CTFE bug.

void foo()
{
    immutable int x = 0;
    auto k = *(){enum e=x;return e;};
}

bug.d(4): Error: can only * a pointer, not a 'immutable(int) delegate() pure
nothrow  safe'

Closure inference for 'is this a delegate literal' vs 'is this a function
literal' incorrectly checks enum initializers.
Similar to bug 6169.

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