- File:
-
- 1 edited
-
src/ResolvExpr/CandidateFinder.cpp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/CandidateFinder.cpp
r9e23b446 rd958834b 41 41 #include "Common/utility.h" // for move, copy 42 42 #include "SymTab/Mangler.h" 43 #include "SymTab/Validate.h" // for validateType44 43 #include "Tuples/Tuples.h" // for handleTupleAssignment 45 44 #include "InitTweak/InitTweak.h" // for getPointerBase … … 898 897 } 899 898 900 if (argType.as<ast::PointerType>()) funcFinder.otypeKeys.insert(Mangle::Encoding::pointer); 901 else if (const ast::EnumInstType * enumInst = argType.as<ast::EnumInstType>()) {902 const ast::EnumDecl * enumDecl = enumInst->base;903 if ( const ast::Type* enumType = enumDecl->base ) {904 // instance of enum (T) is a instance of type (T)905 funcFinder.otypeKeys.insert(Mangle::mangle(enumType, Mangle::NoGenericParams | Mangle::Type));906 } else {907 // instance of an untyped enum is techically int908 funcFinder.otypeKeys.insert(Mangle::mangle(enumDecl, Mangle::NoGenericParams | Mangle::Type));909 }910 }899 if (argType.as<ast::PointerType>()) funcFinder.otypeKeys.insert(Mangle::Encoding::pointer); 900 // else if (const ast::EnumInstType * enumInst = argType.as<ast::EnumInstType>()) { 901 // const ast::EnumDecl * enumDecl = enumInst->base; // Here 902 // if ( const ast::Type* enumType = enumDecl->base ) { 903 // // instance of enum (T) is a instance of type (T) 904 // funcFinder.otypeKeys.insert(Mangle::mangle(enumType, Mangle::NoGenericParams | Mangle::Type)); 905 // } else { 906 // // instance of an untyped enum is techically int 907 // funcFinder.otypeKeys.insert(Mangle::mangle(enumDecl, Mangle::NoGenericParams | Mangle::Type)); 908 // } 909 // } 911 910 else funcFinder.otypeKeys.insert(Mangle::mangle(argType, Mangle::NoGenericParams | Mangle::Type)); 912 911 } … … 1091 1090 assert( toType ); 1092 1091 toType = resolveTypeof( toType, context ); 1093 // toType = SymTab::validateType( castExpr->location, toType, symtab );1094 1092 toType = adjustExprType( toType, tenv, symtab ); 1095 1093 … … 1265 1263 newExpr, copy( tenv ), ast::OpenVarSet{}, ast::AssertionSet{}, Cost::zero, 1266 1264 cost ); 1267 1268 if (newCand->expr->env) {1269 newCand->env.add(*newCand->expr->env);1270 auto mutExpr = newCand->expr.get_and_mutate();1271 mutExpr->env = nullptr;1272 newCand->expr = mutExpr;1273 }1274 1275 1265 PRINT( 1276 1266 std::cerr << "decl is "; … … 1590 1580 // calculate target type 1591 1581 const ast::Type * toType = resolveTypeof( initAlt.type, context ); 1592 // toType = SymTab::validateType( initExpr->location, toType, symtab );1593 1582 toType = adjustExprType( toType, tenv, symtab ); 1594 1583 // The call to find must occur inside this loop, otherwise polymorphic return
Note:
See TracChangeset
for help on using the changeset viewer.