Changes in src/GenPoly/GenPoly.cc [e9b5043:93c10de]
- File:
-
- 1 edited
-
src/GenPoly/GenPoly.cc (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/GenPoly/GenPoly.cc
re9b5043 r93c10de 24 24 #include <vector> // for vector 25 25 26 #include "AST/Expr.hpp"27 26 #include "AST/Type.hpp" 28 #include "AST/TypeSubstitution.hpp"29 27 #include "GenPoly/ErasableScopedMap.h" // for ErasableScopedMap<>::const_it... 30 28 #include "ResolvExpr/typeops.h" // for flatten … … 172 170 173 171 if ( TypeInstType *typeInst = dynamic_cast< TypeInstType * >( type ) ) { 174 if ( tyVars. contains( typeInst->get_name()) ) {172 if ( tyVars.find( typeInst->get_name() ) != tyVars.end() ) { 175 173 return type; 176 174 } … … 189 187 190 188 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; 192 190 } else if ( auto arrayType = dynamic_cast< const ast::ArrayType * >( type ) ) { 193 191 return isPolyType( arrayType->base, env ); … … 205 203 206 204 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; 208 206 } else if ( auto array = dynamic_cast< const ast::ArrayType * >( type ) ) { 209 207 return isPolyType( array->base, subst ); … … 393 391 394 392 if ( TypeInstType *typeInstType = dynamic_cast< TypeInstType * >( type ) ) { 395 if ( tyVars. contains( typeInstType->get_name()) ) {393 if ( tyVars.find( typeInstType->get_name() ) != tyVars.end() ) { 396 394 return true; 397 395 } … … 492 490 } 493 491 494 /// Flattens a list of types.495 // There is another flattenList in Unify.496 492 void flattenList( vector<ast::ptr<ast::Type>> const & src, 497 493 vector<ast::ptr<ast::Type>> & out ) {
Note:
See TracChangeset
for help on using the changeset viewer.