Note: This website is archived. For up-to-date information about D projects and development, please visit wiki.dlang.org.

Changeset 615

Show
Ignore:
Timestamp:
08/11/10 02:47:39 (14 years ago)
Author:
walter
Message:

auto return type forward ref fix

Files:

Legend:

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

    r590 r615  
    71337133            goto Lagain; 
    71347134        } 
    71357135 
    71367136        accessCheck(loc, sc, NULL, f); 
    71377137 
    71387138        ve->var = f; 
    71397139//      ve->hasOverloads = 0; 
    71407140        ve->type = f->type; 
    71417141        t1 = f->type; 
    71427142    } 
    71437143    assert(t1->ty == Tfunction); 
    71447144    tf = (TypeFunction *)(t1); 
    71457145 
    71467146Lcheckargs: 
    71477147    assert(tf->ty == Tfunction); 
    71487148 
    71497149    if (!arguments) 
    71507150        arguments = new Expressions(); 
    71517151    type = functionParameters(loc, sc, tf, arguments); 
    71527152 
     7153    if (!type && f && f->scope) 
     7154    {   f->semantic3(f->scope); 
     7155        type = f->type->nextOf(); 
     7156    } 
     7157 
    71537158    if (!type) 
    71547159    { 
    71557160        error("forward reference to inferred return type of function call %s", toChars()); 
    71567161        return new ErrorExp(); 
    71577162    } 
    71587163 
    71597164    if (f && f->tintro) 
    71607165    { 
    71617166        Type *t = type; 
    71627167        int offset = 0; 
    71637168        TypeFunction *tf = (TypeFunction *)f->tintro; 
    71647169 
    71657170        if (tf->next->isBaseOf(t, &offset) && offset) 
    71667171        { 
    71677172            type = tf->next; 
    71687173            return castTo(sc, t); 
    71697174        } 
    71707175    } 
    71717176 
    71727177    return this;