Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Print.cpp

    r37cdd97 ref9988b  
    2929
    3030template <typename C, typename... T>
    31 constexpr auto make_array(T&&... values) ->
    32         array<C,sizeof...(T)>
     31constexpr array<C,sizeof...(T)> make_array(T&&... values)
    3332{
    3433        return array<C,sizeof...(T)>{
     
    129128
    130129        void print( const ast::Expr::InferUnion & inferred, unsigned level = 0 ) {
    131                 switch ( inferred.mode ) {
    132                 case ast::Expr::InferUnion::Empty: return;
    133                 case ast::Expr::InferUnion::Slots: {
    134                         os << indent << "with " << inferred.data.resnSlots.size()
     130                if (inferred.data.resnSlots && !inferred.data.resnSlots->empty()) {
     131                        os << indent << "with " << inferred.data.resnSlots->size()
    135132                           << " pending inference slots" << endl;
    136                         return;
    137                 }
    138                 case ast::Expr::InferUnion::Params: {
     133                }
     134                if (inferred.data.inferParams && !inferred.data.inferParams->empty()) {
    139135                        os << indent << "with inferred parameters " << level << ":" << endl;
    140136                        ++indent;
    141                         for ( const auto & i : inferred.data.inferParams ) {
     137                        for ( const auto & i : *inferred.data.inferParams ) {
    142138                                os << indent;
    143                                 short_print( Decl::fromId( i.second.decl ) );
     139                                short_print( i.second.declptr );
    144140                                os << endl;
    145141                                print( i.second.expr->inferred, level+1 );
    146142                        }
    147143                        --indent;
    148                         return;
    149                 }
    150144                }
    151145        }
     
    233227                }
    234228
    235                 if ( ! short_mode && ! node->assertions.empty() ) {
     229                if ( ! node->assertions.empty() ) {
    236230                        os << endl << indent << "... with assertions" << endl;
    237231                        ++indent;
     
    243237        void postprint( const ast::Expr * node ) {
    244238                print( node->inferred );
     239
     240                if ( node->result ) {
     241                        os << endl << indent << "... with resolved type:" << endl;
     242                        ++indent;
     243                        os << indent;
     244                        node->result->accept( *this );
     245                        --indent;
     246                }
    245247
    246248                if ( node->env ) {
     
    842844        virtual const ast::Expr * visit( const ast::CastExpr * node ) override final {
    843845                ++indent;
    844                 os << (node->isGenerated ? "Generated" : "Explicit") << " cast of:" << endl << indent;
     846                os << (node->isGenerated ? "Generated" : "Explicit") << " Cast of:" << endl << indent;
    845847                safe_print( node->arg );
    846848                os << endl << indent-1 << "... to:";
Note: See TracChangeset for help on using the changeset viewer.