Ignore:
Timestamp:
Aug 31, 2020, 6:55:22 PM (15 months ago)
Author:
Fangren Yu <f37yu@…>
Branches:
arm-eh, jacob/cs343-translation, master, new-ast-unique-expr
Children:
25a1cb0, 68f0c4e
Parents:
49a980b
Message:

pure visitor interface for new ast

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/Unify.cc

    r49a980b rd3aa64f  
    767767                /// If this isn't done when satifying ttype assertions, then argument lists can have
    768768                /// different size and structure when they should be compatible.
    769                 struct TtypeExpander_new : public ast::WithShortCircuiting {
     769                struct TtypeExpander_new : public ast::WithShortCircuiting, public ast::PureVisitor {
    770770                        ast::TypeEnvironment & tenv;
    771771
     
    793793                                // TtypeExpander pass is impure (may mutate nodes in place)
    794794                                // need to make nodes shared to prevent accidental mutation
    795                                 ast::ptr<ast::DeclWithType> dc = d;
    796                                 dc = dc->accept( expander );
     795                                ast::ptr<ast::DeclWithType> dc = d->accept(expander);
    797796                                auto types = flatten( dc->get_type() );
    798797                                for ( ast::ptr< ast::Type > & t : types ) {
     
    11141113                        ast::Pass<TtypeExpander_new> expander{ tenv };
    11151114
    1116                         ast::ptr<ast::TupleType> tuplec = tuple;
    1117                         ast::ptr<ast::TupleType> tuple2c = tuple2;
    1118                         const ast::Type * flat = tuplec->accept( expander );
    1119                         const ast::Type * flat2 = tuple2c->accept( expander );
     1115                        // ast::ptr<ast::TupleType> tuplec = tuple;
     1116                        // ast::ptr<ast::TupleType> tuple2c = tuple2;
     1117                        const ast::Type * flat = tuple->accept( expander );
     1118                        const ast::Type * flat2 = tuple2->accept( expander );
    11201119
    11211120                        auto types = flatten( flat );
Note: See TracChangeset for help on using the changeset viewer.