Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/CurrentObject.cc

    rda5ac2e r2908f08  
    498498                PRINT( std::cerr << "____untyped: " << expr << std::endl; )
    499499                auto dit = desigAlts.begin();
    500                 auto nexpr = dynamic_cast< const NameExpr * >( expr );
    501500
    502501                for ( const Type * t : curTypes ) {
    503502                        assert( dit != desigAlts.end() );
    504503                        DesignatorChain & d = *dit;
    505                         // Name Designation:
    506                         if ( nexpr ) {
     504                        if ( auto nexpr = dynamic_cast< const NameExpr *>( expr ) ) {
    507505                                PRINT( std::cerr << "____actual: " << t << std::endl; )
    508506                                if ( auto refType = dynamic_cast< const BaseInstType * >( t ) ) {
     
    517515                                                }
    518516                                        }
     517                                } else if ( auto at = dynamic_cast< const ArrayType * >( t ) ) {
     518                                        auto nexpr = dynamic_cast< const NameExpr *>( expr );
     519                                        for ( const Decl * mem : refType->lookup( nexpr->name ) ) {
     520                                                if ( auto field = dynamic_cast< const ObjectDecl * >( mem ) ) {
     521                                                        DesignatorChain d2 = d;
     522                                                        d2.emplace_back( new VariableExpr{ expr->location, field } );
     523                                                        newDesigAlts.emplace_back( std::move( d2 ) );
     524                                                        newTypes.emplace_back( at->base );
     525                                                }
     526                                        }
    519527                                }
    520528
    521529                                ++dit;
    522                         // Index Designation:
    523530                        } else {
    524531                                if ( auto at = dynamic_cast< const ArrayType * >( t ) ) {
Note: See TracChangeset for help on using the changeset viewer.