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


Rainer Schuetze <r.sagita...@gmx.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch
                 CC|                            |r.sagita...@gmx.de


--- Comment #6 from Rainer Schuetze <r.sagita...@gmx.de> 2010-05-11 13:08:56 
PDT ---
I just stumbled over this issue, too. What needs to done is to infer the return
type of the function (calling semantic3 on the function at a rather early stage
of compilation). Here's the patch:

Index: expression.c
===================================================================
--- expression.c    (revision 483)
+++ expression.c    (working copy)
@@ -2448,6 +2448,9 @@

         if (!f->originalType && f->scope)       // semantic not yet run
             f->semantic(f->scope);
+        // if inferring return type, sematic3 needs to be run
+        if(f->inferRetType && f->type && !f->type->nextOf())
+            f->semantic3(f->scope);
         if (!f->type->deco)
         {
             error("forward reference to %s", toChars());

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

Reply via email to