Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/CandidateFinder.cpp

    r9e23b446 rd958834b  
    4141#include "Common/utility.h"       // for move, copy
    4242#include "SymTab/Mangler.h"
    43 #include "SymTab/Validate.h"      // for validateType
    4443#include "Tuples/Tuples.h"        // for handleTupleAssignment
    4544#include "InitTweak/InitTweak.h"  // for getPointerBase
     
    898897                                                }
    899898
    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 int
    908                                                                 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                                                // }
    911910                                                else funcFinder.otypeKeys.insert(Mangle::mangle(argType, Mangle::NoGenericParams | Mangle::Type));
    912911                                        }
     
    10911090                        assert( toType );
    10921091                        toType = resolveTypeof( toType, context );
    1093                         // toType = SymTab::validateType( castExpr->location, toType, symtab );
    10941092                        toType = adjustExprType( toType, tenv, symtab );
    10951093
     
    12651263                                        newExpr, copy( tenv ), ast::OpenVarSet{}, ast::AssertionSet{}, Cost::zero,
    12661264                                        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 
    12751265                                PRINT(
    12761266                                        std::cerr << "decl is ";
     
    15901580                                // calculate target type
    15911581                                const ast::Type * toType = resolveTypeof( initAlt.type, context );
    1592                                 // toType = SymTab::validateType( initExpr->location, toType, symtab );
    15931582                                toType = adjustExprType( toType, tenv, symtab );
    15941583                                // The call to find must occur inside this loop, otherwise polymorphic return
Note: See TracChangeset for help on using the changeset viewer.