Changeset 616

Show
Ignore:
Timestamp:
08/12/10 02:10:46 (2 years ago)
Author:
walter
Message:

bugzilla 3294 forward reference to inferred return type of function call

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/expression.c

    r615 r616  
    494494 
    495495Type *functionParameters(Loc loc, Scope *sc, TypeFunction *tf, 
    496         Expressions *arguments
     496        Expressions *arguments, FuncDeclaration *fd
    497497{ 
    498498    //printf("functionParameters()\n"); 
     
    780780        arguments->insert(0, e); 
    781781    } 
     782 
     783    // If inferring return type, and semantic3() needs to be run if not already run 
     784    if (!tf->next && fd->inferRetType) 
     785        fd->semantic3(fd->scope); 
     786 
    782787    Type *tret = tf->next; 
    783788    if (wildmatch) 
     
    38373842            if (!arguments) 
    38383843                arguments = new Expressions(); 
    3839             functionParameters(loc, sc, tf, arguments); 
     3844            functionParameters(loc, sc, tf, arguments, f); 
    38403845 
    38413846            type = type->addMod(tf->nextOf()->mod); 
     
    38623867 
    38633868            tf = (TypeFunction *)f->type; 
    3864             functionParameters(loc, sc, tf, newargs); 
     3869            functionParameters(loc, sc, tf, newargs, f); 
    38653870        } 
    38663871        else 
     
    38943899            if (!arguments) 
    38953900                arguments = new Expressions(); 
    3896             functionParameters(loc, sc, tf, arguments); 
     3901            functionParameters(loc, sc, tf, arguments, f); 
    38973902        } 
    38983903        else 
     
    39183923 
    39193924            tf = (TypeFunction *)f->type; 
    3920             functionParameters(loc, sc, tf, newargs); 
     3925            functionParameters(loc, sc, tf, newargs, f); 
    39213926#if 0 
    39223927            e = new VarExp(loc, f); 
     
    71497154    if (!arguments) 
    71507155        arguments = new Expressions(); 
    7151     type = functionParameters(loc, sc, tf, arguments); 
    7152  
    7153     if (!type && f && f->scope) 
    7154     {   f->semantic3(f->scope); 
    7155         type = f->type->nextOf(); 
    7156     } 
     7156    type = functionParameters(loc, sc, tf, arguments, f); 
    71577157 
    71587158    if (!type) 
  • trunk/src/mars.c

    r584 r616  
    9292#endif 
    9393    ; 
    94     version = "v2.048"; 
     94    version = "v2.049"; 
    9595    global.structalign = 8; 
    9696