Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/GenPoly/GenPoly.cc

    re9b5043 r93c10de  
    2424#include <vector>                       // for vector
    2525
    26 #include "AST/Expr.hpp"
    2726#include "AST/Type.hpp"
    28 #include "AST/TypeSubstitution.hpp"
    2927#include "GenPoly/ErasableScopedMap.h"  // for ErasableScopedMap<>::const_it...
    3028#include "ResolvExpr/typeops.h"         // for flatten
     
    172170
    173171                if ( TypeInstType *typeInst = dynamic_cast< TypeInstType * >( type ) ) {
    174                         if ( tyVars.contains( typeInst->get_name() ) ) {
     172                        if ( tyVars.find( typeInst->get_name() ) != tyVars.end() ) {
    175173                                return type;
    176174                        }
     
    189187
    190188                if ( auto typeInst = dynamic_cast< const ast::TypeInstType * >( type ) ) {
    191                         if ( tyVars.contains( typeInst->typeString() ) ) return type;
     189                        return tyVars.find(typeInst->typeString()) != tyVars.end() ? type : nullptr;
    192190                } else if ( auto arrayType = dynamic_cast< const ast::ArrayType * >( type ) ) {
    193191                        return isPolyType( arrayType->base, env );
     
    205203
    206204        if ( auto inst = dynamic_cast< const ast::TypeInstType * >( type ) ) {
    207                 if ( typeVars.contains( *inst ) ) return type;
     205                if ( typeVars.find( *inst ) != typeVars.end() ) return type;
    208206        } else if ( auto array = dynamic_cast< const ast::ArrayType * >( type ) ) {
    209207                return isPolyType( array->base, subst );
     
    393391
    394392                if ( TypeInstType *typeInstType = dynamic_cast< TypeInstType * >( type ) ) {
    395                         if ( tyVars.contains( typeInstType->get_name() ) ) {
     393                        if ( tyVars.find( typeInstType->get_name() ) != tyVars.end() ) {
    396394                                return true;
    397395                        }
     
    492490                }
    493491
    494                 /// Flattens a list of types.
    495                 // There is another flattenList in Unify.
    496492                void flattenList( vector<ast::ptr<ast::Type>> const & src,
    497493                                vector<ast::ptr<ast::Type>> & out ) {
Note: See TracChangeset for help on using the changeset viewer.