Wiki Roadmap Timeline Tickets New Ticket Source Search Help / Guide About Trac Login

Changeset 1629:b07d683ba4d0

Show
Ignore:
Timestamp:
01/06/10 13:53:35 (8 months ago)
Author:
Christian Kamm <kamm incasoftware de>
branch:
default
Message:

Disable appending a dchar to a char or wchar array for now.

See [1605] for details.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • dmd/expression.c

    Revision 1627:e83f0778c260 Revision 1629:b07d683ba4d0
    8542    if ((tb1->ty == Tarray) && 8542    if ((tb1->ty == Tarray) && 
    8543    (tb2->ty == Tarray || tb2->ty == Tsarray) && 8543    (tb2->ty == Tarray || tb2->ty == Tsarray) && 
    8544    (e2->implicitConvTo(e1->type) 8544    (e2->implicitConvTo(e1->type) 
    8545#if DMDV2 8545#if DMDV2 
    8546     || tb2->nextOf()->implicitConvTo(tb1next) 8546     || tb2->nextOf()->implicitConvTo(tb1next) 
    8547#endif 8547#endif 
    8548    ) 8548    ) 
    8549       ) 8549       ) 
    8550    {   // Append array 8550    {   // Append array 
    8551    e2 = e2->castTo(sc, e1->type); 8551    e2 = e2->castTo(sc, e1->type); 
    8552    type = e1->type; 8552    type = e1->type; 
    8553    e = this; 8553    e = this; 
    8554    } 8554    } 
    8555    else if ((tb1->ty == Tarray) && 8555    else if ((tb1->ty == Tarray) && 
    8556    e2->implicitConvTo(tb1next) 8556    e2->implicitConvTo(tb1next) 
    8557       ) 8557       ) 
    8558    {   // Append element 8558    {   // Append element 
    8559    e2 = e2->castTo(sc, tb1next); 8559    e2 = e2->castTo(sc, tb1next); 
    8560    type = e1->type; 8560    type = e1->type; 
    8561    e = this; 8561    e = this; 
    8562    }  8562 // Reenable when _d_arrayappendwd and cd are in the runtime. 
       8563 /*    } 
       8564  
    8563    else if (tb1->ty == Tarray && 8565    else if (tb1->ty == Tarray && 
    8564    (tb1next->ty == Tchar || tb1next->ty == Twchar) && 8566    (tb1next->ty == Tchar || tb1next->ty == Twchar) && 
    8565    e2->implicitConvTo(Type::tdchar) 8567    e2->implicitConvTo(Type::tdchar) 
    8566       ) 8568       ) 
    8567    {   // Append dchar to char[] or wchar[] 8569    {   // Append dchar to char[] or wchar[] 
    8568    e2 = e2->castTo(sc, Type::tdchar); 8570    e2 = e2->castTo(sc, Type::tdchar); 
    8569    type = e1->type; 8571    type = e1->type; 
    8570    e = this; 8572    e = this; 
    8571 8573 
    8572    /* Do not allow appending wchar to char[] because if wchar happens 8574    /* Do not allow appending wchar to char[] because if wchar happens 
    8573     * to be a surrogate pair, nothing good can result. 8575     * to be a surrogate pair, nothing good can result. 
    8574     */ 8576     */ 
    8575    } 8577    } 
    8576    else 8578    else 
    8577    { 8579    { 
    8578    error("cannot append type %s to type %s", tb2->toChars(), tb1->toChars()); 8580    error("cannot append type %s to type %s", tb2->toChars(), tb1->toChars()); 
    8579    e = new ErrorExp(); 8581    e = new ErrorExp(); 
    8580    } 8582    } 
    8581    return e; 8583    return e; 
    8582} 8584} 
Copyright © 2008, LDC Development Team.