Changes in src/ResolvExpr/Unify.cc [eb50842:843054c2]
- File:
-
- 1 edited
-
src/ResolvExpr/Unify.cc (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/Unify.cc
reb50842 r843054c2 73 73 }; 74 74 75 /// Attempts an inexact unification of type1 and type2.76 /// Returns false if no such unification; if the types can be unified, sets common (unless they unify exactly and have identical type qualifiers)77 75 bool unifyInexact( Type *type1, Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, const OpenVarSet &openVars, WidenMode widenMode, const SymTab::Indexer &indexer, Type *&common ); 78 76 bool unifyExact( Type *type1, Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, const OpenVarSet &openVars, WidenMode widenMode, const SymTab::Indexer &indexer ); … … 150 148 if ( curClass.type ) { 151 149 Type *common = 0; 152 // attempt to unify equivalence class type (which has qualifiers stripped, so they must be restored) with the type to bind to153 150 std::auto_ptr< Type > newType( curClass.type->clone() ); 154 newType->get_qualifiers() = typeInst->get_qualifiers();155 151 if ( unifyInexact( newType.get(), other, env, needAssertions, haveAssertions, openVars, widenMode & WidenMode( curClass.allowWidening, true ), indexer, common ) ) { 156 152 if ( common ) { … … 283 279 TypeEnvironment debugEnv( env ); 284 280 #endif 285 if ( type1->get_qualifiers() != type2->get_qualifiers() ) {286 return false;287 }288 289 281 bool result; 290 282 TypeInstType *var1 = dynamic_cast< TypeInstType* >( type1 ); … … 299 291 bool isopen1 = var1 && ( entry1 != openVars.end() ); 300 292 bool isopen2 = var2 && ( entry2 != openVars.end() ); 301 302 if ( isopen1 && isopen2 && entry1->second == entry2->second ) { 293 if ( type1->get_qualifiers() != type2->get_qualifiers() ) { 294 return false; 295 } else if ( isopen1 && isopen2 && entry1->second == entry2->second ) { 303 296 result = bindVarToVar( var1, var2, entry1->second, env, needAssertions, haveAssertions, openVars, widenMode, indexer ); 304 297 } else if ( isopen1 ) {
Note:
See TracChangeset
for help on using the changeset viewer.