src/AST/TypeEnvironment.cpp
void filterOverlappingClasses( std::list<EqvClass> & env, const EqvClass & eqvClass ) {
		auto i = env.begin();
		while ( i != env.end() ) {
			auto next = i; ++next;  // save next node in case of erasure

			for ( const auto & v : eqvClass.vars ) {
				if ( i->vars.count( v ) ) {
					env.erase( i );  // remove overlapping class
					break;           // done with this class
				}
			}

			i = next;  // go to next node even if this removed
		}
	}
/// Removes any class from env that intersects eqvClass
Removes any class from env that intersects eqvClass
Removes any class from env that intersects eqvClass
void filterOverlappingClasses( std::list<EqvClass> & env, const EqvClass & eqvClass ) {
		auto i = env.begin();
		while ( i != env.end() ) {
			auto next = i; ++next;  
			for ( const auto & v : eqvClass.vars ) {
				if ( i->vars.count( v ) ) {
					env.erase( i );  
					break;           
				}
			}
			i = next;  
		}
	}
void filterOverlappingClasses ( std :: list < EqvClass > & env , const EqvClass & eqvClass ) { auto i = env . begin ( ) ; while ( i != env . end ( ) ) { auto next = i ; ++ next ; for ( const auto & v : eqvClass . vars ) { if ( i -> vars . count ( v ) ) { env . erase ( i ) ; break ; } } i = next ; } }
Removes any class from env that intersects eqvClass
Removes any class from env that intersects eqvClass
// save next node in case of erasure // remove overlapping class // done with this class // go to next node even if this removed