Ignore:
Timestamp:
Aug 20, 2018, 2:07:33 PM (3 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, no_list, persistent-indexer
Children:
ec91336
Parents:
39c4dac
Message:

Fix unhandled enum warning in TypeEnvironment?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/TypeEnvironment.cc

    r39c4dac r51a455c  
    6969        }
    7070
    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},
    7373          allowWidening{std::move(other.allowWidening)}, data{std::move(other.data)} {
    7474                  other.type = nullptr;
     
    8585                if ( this == &other ) return *this;
    8686                delete type;
    87                
     87
    8888                vars = std::move(other.vars);
    8989                type = other.type;
     
    132132                        ++next;
    133133                        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(),
    135135                                std::inserter( intersection, intersection.begin() ) );
    136136                        if ( ! intersection.empty() ) { env.erase( i ); }
     
    240240                        // ttype unifies with any tuple type
    241241                        return dynamic_cast< TupleType * >( type ) || Tuples::isTtype( type );
     242                  default:
     243                        assertf(false, "Unhandled tyvar kind: %d", data.kind);
    242244                } // switch
    243245                return false;
     
    245247
    246248        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
    248250                // remove references from other, so that type variables can only bind to value types
    249251                bindTo = bindTo->stripReferences();
     
    291293                auto class1 = internal_lookup( var1->get_name() );
    292294                auto class2 = internal_lookup( var2->get_name() );
    293                
     295
    294296                // exit early if variables already bound together
    295297                if ( class1 != env.end() && class1 == class2 ) {
Note: See TracChangeset for help on using the changeset viewer.