Changes in / [ee68e11:a4dd728]


Ignore:
Location:
src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/GenPoly/InstantiateGeneric.cc

    ree68e11 ra4dd728  
    255255                }
    256256
    257                 assertf( baseParam == baseParams.end() && param == params.end(), "Type parameters should match type variables" );
     257                assert( baseParam == baseParams.end() && param == params.end() && "Type parameters should match type variables" );
    258258                return gt;
    259259        }
  • src/ResolvExpr/Unify.cc

    ree68e11 ra4dd728  
    134134                  case TypeDecl::Ftype:
    135135                        return isFtype( type, indexer );
    136                   case TypeDecl::Ttype:
     136                        case TypeDecl::Ttype:
    137137                        // ttype unifies with any tuple type
    138138                        return dynamic_cast< TupleType * >( type ) || Tuples::isTtype( type );
     
    592592                for ( ; it != params.end() && jt != otherParams.end(); ++it, ++jt ) {
    593593                        TypeExpr *param = dynamic_cast< TypeExpr* >(*it);
    594                         assertf(param, "Aggregate parameters should be type expressions");
     594                        assert(param && "Aggregate parameters should be type expressions");
    595595                        TypeExpr *otherParam = dynamic_cast< TypeExpr* >(*jt);
    596                         assertf(otherParam, "Aggregate parameters should be type expressions");
    597                        
    598                         Type* paramTy = param->get_type();
    599                         Type* otherParamTy = otherParam->get_type();
    600 
    601                         bool tupleParam = Tuples::isTtype( paramTy );
    602                         bool otherTupleParam = Tuples::isTtype( otherParamTy );
    603 
    604                         if ( tupleParam && otherTupleParam ) {
    605                                 ++it; ++jt;  // skip ttype parameters for break
    606                         } else if ( tupleParam ) {
    607                                 // bundle other parameters into tuple to match
    608                                 TupleType* binder = new TupleType{ paramTy->get_qualifiers() };
    609 
    610                                 do {
    611                                         binder->get_types().push_back( otherParam->get_type()->clone() );
    612                                         ++jt;
    613 
    614                                         if ( jt == otherParams.end() ) break;
    615 
    616                                         otherParam = dynamic_cast< TypeExpr* >(*jt);
    617                                         assertf(otherParam, "Aggregate parameters should be type expressions");
    618                                 } while (true);
    619 
    620                                 otherParamTy = binder;
    621                                 ++it;  // skip ttype parameter for break
    622                         } else if ( otherTupleParam ) {
    623                                 // bundle parameters into tuple to match other
    624                                 TupleType* binder = new TupleType{ otherParamTy->get_qualifiers() };
    625 
    626                                 do {
    627                                         binder->get_types().push_back( param->get_type()->clone() );
    628                                         ++it;
    629 
    630                                         if ( it == params.end() ) break;
    631 
    632                                         param = dynamic_cast< TypeExpr* >(*it);
    633                                         assertf(param, "Aggregate parameters should be type expressions");
    634                                 } while (true);
    635 
    636                                 paramTy = binder;
    637                                 ++jt;  // skip ttype parameter for break
    638                         }
    639 
    640                         if ( ! unifyExact( paramTy, otherParamTy, env, needAssertions, haveAssertions, openVars, WidenMode(false, false), indexer ) ) {
     596                        assert(otherParam && "Aggregate parameters should be type expressions");
     597
     598                        if ( ! unifyExact( param->get_type(), otherParam->get_type(), env, needAssertions, haveAssertions, openVars, WidenMode(false, false), indexer ) ) {
    641599                                result = false;
    642600                                return;
    643601                        }
    644 
    645                         // ttype parameter should be last
    646                         if ( tupleParam || otherTupleParam ) break;
    647602                }
    648603                result = ( it == params.end() && jt == otherParams.end() );
Note: See TracChangeset for help on using the changeset viewer.