http://d.puremagic.com/issues/show_bug.cgi?id=2399


Don <clugd...@yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch




--- Comment #3 from Don <clugd...@yahoo.com.au>  2009-05-15 14:35:46 PDT ---
The root cause is in cast.c, 
Expression *SymOffExp::castTo(Scope *sc, Type *t).
Casting from a function pointer to a delegate must be forbidden.
This patch also fixes Bug 2875.


============
   else if (tb->ty == Tdelegate && f->isNested())
    {
    e = new DelegateExp(loc, new IntegerExp(0), f);
    e = e->semantic(sc);
   } 
+    else if (tb->ty == Tdelegate) {
+    error("Cannot cast from function pointer to delegate");
+        return this;
+   }
    else
    {
    e = new SymOffExp(loc, f, 0);
    e->type = t;
    }

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

Reply via email to