Index: src/ResolvExpr/TypeEnvironment.h
===================================================================
--- src/ResolvExpr/TypeEnvironment.h	(revision f474e917671c80fd81b2ffce8b4dac26709b333e)
+++ src/ResolvExpr/TypeEnvironment.h	(revision fd642d2c3aee132ffbce05c2d7092e4dac7fa8d0)
@@ -9,7 +9,7 @@
 // Author           : Richard C. Bilson
 // Created On       : Sun May 17 12:24:58 2015
-// Last Modified By : Peter A. Buhr
-// Last Modified On : Tue Apr 30 23:04:10 2019
-// Update Count     : 9
+// Last Modified By : Andrew Beach
+// Last Modified On : Fri Jul 19 17:00:10 2019
+// Update Count     : 10
 //
 
@@ -40,5 +40,5 @@
 	// declarations.
 	//
-	// I've seen a TU go from 54 minutes to 1 minute 34 seconds with the addition of this 
+	// I've seen a TU go from 54 minutes to 1 minute 34 seconds with the addition of this
 	// comparator.
 	//
@@ -46,12 +46,12 @@
 	// memory layout can alter compilation time in unpredictable ways. For example, the placement
 	// of a line directive can reorder type pointers with respect to each other so that assertions
-	// are seen in different orders, causing a potentially different number of unification calls 
-	// when resolving assertions. I've seen a TU go from 36 seconds to 27 seconds by reordering 
-	// line directives alone, so it would be nice to fix this comparison so that assertions compare 
-	// more consistently. I've tried to modify this to compare on mangle name instead of type as 
-	// the second comparator, but this causes some assertions to never be recorded. More 
+	// are seen in different orders, causing a potentially different number of unification calls
+	// when resolving assertions. I've seen a TU go from 36 seconds to 27 seconds by reordering
+	// line directives alone, so it would be nice to fix this comparison so that assertions compare
+	// more consistently. I've tried to modify this to compare on mangle name instead of type as
+	// the second comparator, but this causes some assertions to never be recorded. More
 	// investigation is needed.
 	struct AssertCompare {
-		bool operator()( DeclarationWithType * d1, DeclarationWithType * d2 ) const {
+		bool operator()( const DeclarationWithType * d1, const DeclarationWithType * d2 ) const {
 			int cmp = d1->get_name().compare( d2->get_name() );
 			return cmp < 0 ||
@@ -65,5 +65,5 @@
 		AssertionSetValue() : isUsed(false), resnSlot(0) {}
 	};
-	typedef std::map< DeclarationWithType *, AssertionSetValue, AssertCompare > AssertionSet;
+	typedef std::map< const DeclarationWithType *, AssertionSetValue, AssertCompare > AssertionSet;
 	typedef std::unordered_map< std::string, TypeDecl::Data > OpenVarSet;
 
@@ -78,5 +78,5 @@
 	struct EqvClass {
 		std::set< std::string > vars;
-		Type *type;
+		Type * type;
 		bool allowWidening;
 		TypeDecl::Data data;
@@ -111,5 +111,5 @@
 		bool isEmpty() const { return env.empty(); }
 		void print( std::ostream &os, Indenter indent = {} ) const;
-		
+
 		/// Simply concatenate the second environment onto this one; no safety checks performed
 		void simpleCombine( const TypeEnvironment &second );
@@ -126,5 +126,5 @@
 		/// Returns false if fails, but does NOT roll back partial changes.
 		bool combine( const TypeEnvironment& second, OpenVarSet& openVars, const SymTab::Indexer& indexer );
-		
+
 		void extractOpenVars( OpenVarSet &openVars ) const;
 		TypeEnvironment *clone() const { return new TypeEnvironment( *this ); }
@@ -134,11 +134,11 @@
 		void addActual( const TypeEnvironment& actualEnv, OpenVarSet& openVars );
 
-		/// Binds the type class represented by `typeInst` to the type `bindTo`; will add 
+		/// Binds the type class represented by `typeInst` to the type `bindTo`; will add
 		/// the class if needed. Returns false on failure.
-		bool bindVar( TypeInstType *typeInst, Type *bindTo, const TypeDecl::Data & data, AssertionSet &need, AssertionSet &have, const OpenVarSet &openVars, WidenMode widen, const SymTab::Indexer &indexer );
-		
-		/// Binds the type classes represented by `var1` and `var2` together; will add 
+		bool bindVar( const TypeInstType * typeInst, Type * bindTo, const TypeDecl::Data & data, AssertionSet &need, AssertionSet &have, const OpenVarSet &openVars, WidenMode widen, const SymTab::Indexer &indexer );
+
+		/// Binds the type classes represented by `var1` and `var2` together; will add
 		/// one or both classes if needed. Returns false on failure.
-		bool bindVarToVar( TypeInstType *var1, TypeInstType *var2, TypeDecl::Data && data, AssertionSet &need, AssertionSet &have, const OpenVarSet &openVars, WidenMode widen, const SymTab::Indexer &indexer );
+		bool bindVarToVar( const TypeInstType * var1, const TypeInstType * var2, TypeDecl::Data && data, AssertionSet &need, AssertionSet &have, const OpenVarSet &openVars, WidenMode widen, const SymTab::Indexer &indexer );
 
 		/// Disallows widening for all bindings in the environment
@@ -151,5 +151,5 @@
 	  private:
 		ClassList env;
-		
+
 		ClassList::iterator internal_lookup( const std::string &var );
 	};
