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

Changeset 225

Show
Ignore:
Timestamp:
10/29/09 19:12:35 (15 years ago)
Author:
walter
Message:

bugzilla 2694

Files:

Legend:

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

    r215 r225  
    444444    // for a type or an alias for a symbol. It is up to the semantic() 
    445445    // pass to distinguish. 
    446446    // If it is a type, then type is set and getType() will return that 
    447447    // type. If it is a symbol, then aliassym is set and type is NULL - 
    448448    // toAlias() will return aliasssym. 
    449449 
    450450    Dsymbol *s; 
    451451    Type *t; 
    452452    Expression *e; 
    453453 
    454454    /* This section is needed because resolve() will: 
    455455     *   const x = 3; 
    456456     *   alias x y; 
    457457     * try to alias y to 3. 
    458458     */ 
    459459    s = type->toDsymbol(sc); 
    460460    if (s && ((s->getType() && type->equals(s->getType())) || s->isEnumMember())) 
    461461    goto L2;            // it's a symbolic alias 
    462462 
    463463#if DMDV2 
    464     if (storage_class & STCref
     464    if (storage_class & (STCref | STCnothrow | STCpure)
    465465    {   // For 'ref' to be attached to function types, and picked 
    466466    // up by Type::resolve(), it has to go into sc. 
    467467    sc = sc->push(); 
    468     sc->stc |= STCref
     468    sc->stc |= storage_class & (STCref | STCnothrow | STCpure)
    469469    type->resolve(loc, sc, &e, &t, &s); 
    470470    sc = sc->pop(); 
    471471    } 
    472472    else 
    473473#endif 
    474474    type->resolve(loc, sc, &e, &t, &s); 
    475475    if (s) 
    476476    { 
    477477    goto L2; 
    478478    } 
    479479    else if (e) 
    480480    { 
    481481    // Try to convert Expression to Dsymbol 
    482482    s = getDsymbol(e); 
    483483    if (s) 
    484484        goto L2; 
    485485 
    486486    error("cannot alias an expression %s", e->toChars()); 
    487487    t = e->type; 
    488488    } 
  • trunk/src/doc.c

    r195 r225  
    657657    hgs.ddoc = 1; 
    658658    toCBuffer(buf, &hgs); 
    659659} 
    660660 
    661661void prefix(OutBuffer *buf, Dsymbol *s) 
    662662{ 
    663663    if (s->isDeprecated()) 
    664664    buf->writestring("deprecated "); 
    665665    Declaration *d = s->isDeclaration(); 
    666666    if (d) 
    667667    { 
    668668    emitProtection(buf, d->protection); 
    669669    if (d->isAbstract()) 
    670670        buf->writestring("abstract "); 
    671671    if (d->isStatic()) 
    672672        buf->writestring("static "); 
    673673    if (d->isConst()) 
    674674        buf->writestring("const "); 
    675675#if DMDV2 
    676676    if (d->isInvariant()) 
    677         buf->writestring("invariant "); 
     677        buf->writestring("immutable "); 
    678678#endif 
    679679    if (d->isFinal()) 
    680680        buf->writestring("final "); 
    681681    if (d->isSynchronized()) 
    682682        buf->writestring("synchronized "); 
    683683    } 
    684684} 
    685685 
    686686void Declaration::toDocBuffer(OutBuffer *buf) 
    687687{ 
    688688    //printf("Declaration::toDocbuffer() %s, originalType = %p\n", toChars(), originalType); 
    689689    if (ident) 
    690690    { 
    691691    prefix(buf, this); 
    692692 
    693693    if (type) 
    694694    {   HdrGenState hgs; 
    695695        hgs.ddoc = 1; 
    696696        if (originalType) 
    697697        {   //originalType->print();