Index: src/ResolvExpr/FindOpenVars.h
===================================================================
--- src/ResolvExpr/FindOpenVars.h	(revision 0f19d763a07f96324b450e9bafd7fdd52807ea0f)
+++ src/ResolvExpr/FindOpenVars.h	(revision eb50842f528b3e34cf566df4d08aa8c6d4b077a8)
@@ -21,4 +21,5 @@
 
 namespace ResolvExpr {
+	// Updates open and closed variables and their associated assertions
 	void findOpenVars( Type *type, OpenVarSet &openVars, OpenVarSet &closedVars, AssertionSet &needAssertions, AssertionSet &haveAssertions, bool firstIsOpen );
 } // namespace ResolvExpr
Index: src/ResolvExpr/Unify.cc
===================================================================
--- src/ResolvExpr/Unify.cc	(revision 0f19d763a07f96324b450e9bafd7fdd52807ea0f)
+++ src/ResolvExpr/Unify.cc	(revision eb50842f528b3e34cf566df4d08aa8c6d4b077a8)
@@ -73,4 +73,6 @@
 	};
 
+	/// Attempts an inexact unification of type1 and type2.
+	/// Returns false if no such unification; if the types can be unified, sets common (unless they unify exactly and have identical type qualifiers)
 	bool unifyInexact( Type *type1, Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, const OpenVarSet &openVars, WidenMode widenMode, const SymTab::Indexer &indexer, Type *&common );
 	bool unifyExact( Type *type1, Type *type2, TypeEnvironment &env, AssertionSet &needAssertions, AssertionSet &haveAssertions, const OpenVarSet &openVars, WidenMode widenMode, const SymTab::Indexer &indexer );
@@ -148,5 +150,7 @@
 			if ( curClass.type ) {
 				Type *common = 0;
+				// attempt to unify equivalence class type (which has qualifiers stripped, so they must be restored) with the type to bind to
 				std::auto_ptr< Type > newType( curClass.type->clone() );
+				newType->get_qualifiers() = typeInst->get_qualifiers();
 				if ( unifyInexact( newType.get(), other, env, needAssertions, haveAssertions, openVars, widenMode & WidenMode( curClass.allowWidening, true ), indexer, common ) ) {
 					if ( common ) {
@@ -279,4 +283,8 @@
 		TypeEnvironment debugEnv( env );
 #endif
+		if ( type1->get_qualifiers() != type2->get_qualifiers() ) {
+			return false;
+		}
+
 		bool result;
 		TypeInstType *var1 = dynamic_cast< TypeInstType* >( type1 );
@@ -291,7 +299,6 @@
 		bool isopen1 = var1 && ( entry1 != openVars.end() );
 		bool isopen2 = var2 && ( entry2 != openVars.end() );
-		if ( type1->get_qualifiers() != type2->get_qualifiers() ) {
-			return false;
-		} else if ( isopen1 && isopen2 && entry1->second == entry2->second ) {
+
+		if ( isopen1 && isopen2 && entry1->second == entry2->second ) {
 			result = bindVarToVar( var1, var2, entry1->second, env, needAssertions, haveAssertions, openVars, widenMode, indexer );
 		} else if ( isopen1 ) {
