Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/ConversionCost.cc

    r89e6ffc r7e003011  
    3030///     std::cout << "type inst " << destAsTypeInst->get_name();
    3131                        if ( env.lookup( destAsTypeInst->get_name(), eqvClass ) ) {
    32                                 return conversionCost( src, eqvClass.type, indexer, env );
     32                                if ( eqvClass.type ) {
     33                                        return conversionCost( src, eqvClass.type, indexer, env );
     34                                } else {
     35                                        return Cost::infinity;
     36                                }
    3337                        } else if ( ( namedType = indexer.lookupType( destAsTypeInst->get_name() ) ) ) {
    3438///       std::cout << " found" << std::endl;
     
    145149        };
    146150
    147         void ConversionCost::visit(VoidType *voidType) {
     151        void ConversionCost::visit( __attribute((unused)) VoidType *voidType ) {
    148152                cost = Cost::infinity;
    149153        }
     
    182186        }
    183187
    184         void ConversionCost::visit(ArrayType *arrayType) {
    185         }
    186 
    187         void ConversionCost::visit(FunctionType *functionType) {
    188         }
     188        void ConversionCost::visit(__attribute((unused)) ArrayType *arrayType) {}
     189        void ConversionCost::visit(__attribute((unused)) FunctionType *functionType) {}
    189190
    190191        void ConversionCost::visit(StructInstType *inst) {
     
    204205        }
    205206
    206         void ConversionCost::visit(EnumInstType *inst) {
     207        void ConversionCost::visit( __attribute((unused)) EnumInstType *inst ) {
    207208                static Type::Qualifiers q;
    208209                static BasicType integer( q, BasicType::SignedInt );
     
    213214        }
    214215
    215         void ConversionCost::visit(TraitInstType *inst) {
     216        void ConversionCost::visit( __attribute((unused)) TraitInstType *inst) {
    216217        }
    217218
     
    235236        }
    236237
    237         void ConversionCost::visit(TupleType *tupleType) {
     238        void ConversionCost::visit( __attribute((unused)) TupleType *tupleType) {
    238239                Cost c;
    239240                if ( TupleType *destAsTuple = dynamic_cast< TupleType* >( dest ) ) {
    240241                        std::list< Type* >::const_iterator srcIt = tupleType->get_types().begin();
    241242                        std::list< Type* >::const_iterator destIt = destAsTuple->get_types().begin();
    242                         while ( srcIt != tupleType->get_types().end() ) {
     243                        while ( srcIt != tupleType->get_types().end() && destIt != destAsTuple->get_types().end() ) {
    243244                                Cost newCost = conversionCost( *srcIt++, *destIt++, indexer, env );
    244245                                if ( newCost == Cost::infinity ) {
     
    255256        }
    256257
    257         void ConversionCost::visit(VarArgsType *varArgsType) {
     258        void ConversionCost::visit( __attribute((unused)) VarArgsType *varArgsType) {
    258259                if ( dynamic_cast< VarArgsType* >( dest ) ) {
    259260                        cost = Cost::zero;
     
    261262        }
    262263
    263         void ConversionCost::visit(ZeroType *zeroType) {
     264        void ConversionCost::visit( __attribute((unused)) ZeroType *zeroType) {
    264265                if ( dynamic_cast< ZeroType* >( dest ) ) {
    265266                        cost = Cost::zero;
     
    277278        }
    278279
    279         void ConversionCost::visit(OneType *oneType) {
     280        void ConversionCost::visit( __attribute((unused)) OneType *oneType) {
    280281                if ( dynamic_cast< OneType* >( dest ) ) {
    281282                        cost = Cost::zero;
Note: See TracChangeset for help on using the changeset viewer.