Ignore:
Timestamp:
May 24, 2019, 10:19:41 AM (6 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, cleanup-dtors, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
d908563
Parents:
6a9d4b4 (diff), 292642a (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' into cleanup-dtors

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/Unify.cc

    r6a9d4b4 r933f32f  
    2121#include <string>                 // for string, operator==, operator!=, bas...
    2222#include <utility>                // for pair, move
    23 
     23#include <vector>
     24
     25#include "AST/Node.hpp"
     26#include "AST/Type.hpp"
    2427#include "Common/PassVisitor.h"   // for PassVisitor
    2528#include "FindOpenVars.h"         // for findOpenVars
     
    172175                bool isopen2 = var2 && ( entry2 != openVars.end() );
    173176
    174                 if ( isopen1 && isopen2 && entry1->second == entry2->second ) {
    175                         result = env.bindVarToVar( var1, var2, entry1->second, needAssertions, haveAssertions, openVars, widenMode, indexer );
     177                if ( isopen1 && isopen2 ) {
     178                        if ( entry1->second.kind != entry2->second.kind ) {
     179                                result = false;
     180                        } else {
     181                                result = env.bindVarToVar(
     182                                        var1, var2, TypeDecl::Data{ entry1->second, entry2->second }, needAssertions,
     183                                        haveAssertions, openVars, widenMode, indexer );
     184                        }
    176185                } else if ( isopen1 ) {
    177186                        result = env.bindVar( var1, type2, entry1->second, needAssertions, haveAssertions, openVars, widenMode, indexer );
     
    624633        }
    625634
    626         // xxx - compute once and store in the FunctionType?
    627635        Type * extractResultType( FunctionType * function ) {
    628636                if ( function->get_returnVals().size() == 0 ) {
     
    638646                }
    639647        }
     648
     649        ast::ptr<ast::Type> extractResultType( const ast::FunctionType * func ) {
     650                assert(!"restore after AST added to build");
     651                // if ( func->returns.empty() ) return new ast::VoidType{};
     652                // if ( func->returns.size() == 1 ) return func->returns[0]->get_type();
     653
     654                // std::vector<ast::ptr<ast::Type>> tys;
     655                // for ( const ast::DeclWithType * decl : func->returns ) {
     656                //      tys.emplace_back( decl->get_type() );
     657                // }
     658                // return new ast::TupleType{ std::move(tys) };
     659        }
    640660} // namespace ResolvExpr
    641661
Note: See TracChangeset for help on using the changeset viewer.