www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 7204] New: [CTFE] Assertion failure when attempting to access function pointer of delegate

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

           Summary: [CTFE] Assertion failure when attempting to access
                    function pointer of delegate
           Product: D
           Version: D2
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: robert octarineparrot.com



20:40:18 GMT ---
----
auto foo()
{
    void delegate() myDg;
    return myDg.funcptr;
}
enum _ = foo();
----
This gives an assertion failure using dmd 2.057:
Assertion failed: (IsStackValueValid(newval)), function createStackValue, file
interpret.c, line 6262.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 02 2012
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7204


SomeDude <lovelydear mailmetrash.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lovelydear mailmetrash.com



PDT ---
Under 2.059 Win32, this won't compile:

auto foo() {
    void delegate() myDg;
    return myDg.funcptr;
}
enum _ = foo();

void main() {}

PS E:\DigitalMars\dmd2\samples> rdmd bug.d
bug.d(4): Error: Cannot convert &void delegate() to void* at compile time
bug.d(6):        called from here: foo()

If we write instead :
enum _ = &foo;

Everything looks fine.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 19 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7204


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WORKSFORME



22:58:05 PDT ---
A correct error message is given by 2.064 head:

test.d(4): Error: Cannot convert &void delegate() to void* at compile time
test.d(6):        called from here: foo()

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