Ignore:
Timestamp:
Dec 16, 2020, 4:01:57 PM (3 years ago)
Author:
Colby Alexander Parsons <caparsons@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
8ba363e, c8025a21
Parents:
b3c8496 (diff), 3e5dd913 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/GenPoly/GenPoly.cc

    rb3c8496 r53449a4  
    115115                if (!env) return type;
    116116                if (auto typeInst = dynamic_cast<const ast::TypeInstType*> (type)) {
    117                         auto newType = env->lookup(typeInst->name);
     117                        auto newType = env->lookup(typeInst);
    118118                        if (newType) return newType;
    119119                }
     
    172172
    173173                if ( auto typeInst = dynamic_cast< const ast::TypeInstType * >( type ) ) {
    174                         return tyVars.find(typeInst->name) != tyVars.end() ? type : nullptr;
     174                        return tyVars.find(typeInst->typeString()) != tyVars.end() ? type : nullptr;
    175175                } else if ( auto arrayType = dynamic_cast< const ast::ArrayType * >( type ) ) {
    176176                        return isPolyType( arrayType->base, env );
     
    552552        }
    553553
    554         void addToTyVarMap( const ast::TypeDecl * tyVar, TyVarMap & tyVarMap) {
    555                 tyVarMap.insert(tyVar->name, convData(ast::TypeDecl::Data{tyVar}));
     554        void addToTyVarMap( const ast::TypeInstType * tyVar, TyVarMap & tyVarMap) {
     555                tyVarMap.insert(tyVar->typeString(), convData(ast::TypeDecl::Data{tyVar->base}));
    556556        }
    557557
     
    567567
    568568        void makeTyVarMap(const ast::Type * type, TyVarMap & tyVarMap) {
    569                 if (auto ptype = dynamic_cast<const ast::ParameterizedType *>(type)) {
     569                if (auto ptype = dynamic_cast<const ast::FunctionType *>(type)) {
    570570                        for (auto & tyVar : ptype->forall) {
    571571                                assert (tyVar);
Note: See TracChangeset for help on using the changeset viewer.