Changeset 51a455c
- Timestamp:
- Aug 20, 2018, 2:07:33 PM (5 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer, pthread-emulation, qualifiedEnum
- Children:
- ec91336
- Parents:
- 39c4dac
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/TypeEnvironment.cc
r39c4dac r51a455c 69 69 } 70 70 71 EqvClass::EqvClass( EqvClass &&other ) 72 : vars{std::move(other.vars)}, type{other.type}, 71 EqvClass::EqvClass( EqvClass &&other ) 72 : vars{std::move(other.vars)}, type{other.type}, 73 73 allowWidening{std::move(other.allowWidening)}, data{std::move(other.data)} { 74 74 other.type = nullptr; … … 85 85 if ( this == &other ) return *this; 86 86 delete type; 87 87 88 88 vars = std::move(other.vars); 89 89 type = other.type; … … 132 132 ++next; 133 133 std::set<std::string> intersection; 134 std::set_intersection( i->vars.begin(), i->vars.end(), eqvClass.vars.begin(), eqvClass.vars.end(), 134 std::set_intersection( i->vars.begin(), i->vars.end(), eqvClass.vars.begin(), eqvClass.vars.end(), 135 135 std::inserter( intersection, intersection.begin() ) ); 136 136 if ( ! intersection.empty() ) { env.erase( i ); } … … 240 240 // ttype unifies with any tuple type 241 241 return dynamic_cast< TupleType * >( type ) || Tuples::isTtype( type ); 242 default: 243 assertf(false, "Unhandled tyvar kind: %d", data.kind); 242 244 } // switch 243 245 return false; … … 245 247 246 248 bool TypeEnvironment::bindVar( TypeInstType *typeInst, Type *bindTo, const TypeDecl::Data & data, AssertionSet &need, AssertionSet &have, const OpenVarSet &openVars, WidenMode widenMode, const SymTab::Indexer &indexer ) { 247 249 248 250 // remove references from other, so that type variables can only bind to value types 249 251 bindTo = bindTo->stripReferences(); … … 291 293 auto class1 = internal_lookup( var1->get_name() ); 292 294 auto class2 = internal_lookup( var2->get_name() ); 293 295 294 296 // exit early if variables already bound together 295 297 if ( class1 != env.end() && class1 == class2 ) {
Note: See TracChangeset
for help on using the changeset viewer.