www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 2845] New: Alias-to-local as template argument + delegate = Access Violation

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

           Summary: Alias-to-local as template argument + delegate = Access
                    Violation
           Product: D
           Version: 2.027
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: kinaba is.s.u-tokyo.ac.jp


Here is the minimal code I can reproduce the problem on DMD 2.028 on Windows
Vista:

struct dep_t(alias a)
{
        int  memvar;
        void memfun() {}
}

dep_t!(a) dep(alias a)()
{
        return dep_t!(a)();
}

void dep_and_del(D)(D a, void delegate() b) { /*nothing*/ }

void main()
{
        int x = 0;
        dep_and_del( dep!(x), {}     );
        dep_and_del( dep!(x), {x=1;} ); // object.Error: Access Violation
}


-- 
Apr 16 2009
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2845


Malte Skarupke <malteskarupke web.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |malteskarupke web.de
         Resolution|                            |FIXED



PDT ---
Works in DMD 2.060. It compiles and runs without issues.

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