Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/Unify.cc

    r62423350 r36a5a77  
    4242                virtual void visit(PointerType *pointerType);
    4343                virtual void visit(ArrayType *arrayType);
     44                virtual void visit(ReferenceType *refType);
    4445                virtual void visit(FunctionType *functionType);
    4546                virtual void visit(StructInstType *aggregateUseType);
     
    142143
    143144        bool bindVar( TypeInstType *typeInst, Type *other, const TypeDecl::Data & data, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, const OpenVarSet &openVars, WidenMode widenMode, const SymTab::Indexer &indexer ) {
     145                // remove references from other, so that type variables can only bind to value types
     146                other = other->stripReferences();
    144147                OpenVarSet::const_iterator tyvar = openVars.find( typeInst->get_name() );
    145148                assert( tyvar != openVars.end() );
     
    376379                                } // if
    377380                        } else {
     381                                common = type1->clone();
     382                                common->get_qualifiers() = tq1 | tq2;
    378383                                result = true;
    379384                        } // if
     
    425430                        markAssertions( haveAssertions, needAssertions, pointerType );
    426431                        markAssertions( haveAssertions, needAssertions, otherPointer );
     432                } // if
     433        }
     434
     435        void Unify::visit(ReferenceType *refType) {
     436                if ( ReferenceType *otherRef = dynamic_cast< ReferenceType* >( type2 ) ) {
     437                        result = unifyExact( refType->get_base(), otherRef->get_base(), env, needAssertions, haveAssertions, openVars, WidenMode( false, false ), indexer );
     438                        markAssertions( haveAssertions, needAssertions, refType );
     439                        markAssertions( haveAssertions, needAssertions, otherRef );
    427440                } // if
    428441        }
Note: See TracChangeset for help on using the changeset viewer.