Changeset d908563 for src/ResolvExpr


Ignore:
Timestamp:
May 27, 2019, 11:08:54 AM (5 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:
f88a252
Parents:
933f32f (diff), 21a44ca (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

    r933f32f rd908563  
    179179                                result = false;
    180180                        } else {
    181                                 result = env.bindVarToVar( 
    182                                         var1, var2, TypeDecl::Data{ entry1->second, entry2->second }, needAssertions, 
     181                                result = env.bindVarToVar(
     182                                        var1, var2, TypeDecl::Data{ entry1->second, entry2->second }, needAssertions,
    183183                                        haveAssertions, openVars, widenMode, indexer );
    184184                        }
     
    648648
    649649        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) };
     650                if ( func->returns.empty() ) return new ast::VoidType{};
     651                if ( func->returns.size() == 1 ) return func->returns[0]->get_type();
     652
     653                std::vector<ast::ptr<ast::Type>> tys;
     654                for ( const ast::DeclWithType * decl : func->returns ) {
     655                        tys.emplace_back( decl->get_type() );
     656                }
     657                return new ast::TupleType{ std::move(tys) };
    659658        }
    660659} // namespace ResolvExpr
Note: See TracChangeset for help on using the changeset viewer.