Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ResolvExpr/Resolver.cc

    r2dda05d r7583c02  
    986986                };
    987987        } // anonymous namespace
    988 
    989988        /// Check if this expression is or includes a deleted expression
    990989        const ast::DeletedExpr * findDeletedExpr( const ast::Expr * expr ) {
     
    11521151                        const ast::Expr * untyped, const ast::SymbolTable & symtab
    11531152                ) {
    1154                         resetTyVarRenaming();
    11551153                        ast::TypeEnvironment env;
    11561154                        ast::ptr< ast::Expr > newExpr = resolveInVoidContext( untyped, symtab, env );
     
    13121310        }
    13131311
    1314         ast::ptr< ast::Expr > resolveStmtExpr(
     1312        const ast::Expr * resolveStmtExpr(
    13151313                const ast::StmtExpr * stmtExpr, const ast::SymbolTable & symtab
    13161314        ) {
    13171315                assert( stmtExpr );
    13181316                ast::Pass< Resolver_new > resolver{ symtab };
    1319                 ast::ptr< ast::Expr > ret = stmtExpr;
    1320                 ret = ret->accept( resolver );
    1321                 strict_dynamic_cast< ast::StmtExpr * >( ret.get_and_mutate() )->computeResult();
     1317                auto ret = mutate(stmtExpr->accept(resolver));
     1318                strict_dynamic_cast< ast::StmtExpr * >( ret )->computeResult();
    13221319                return ret;
    13231320        }
     
    13751372                        }
    13761373
    1377                         // handle assertions. (seems deep)
     1374                        // handle assertions
    13781375
    13791376                        symtab.enterScope();
    1380                         for (auto & typeParam : mutType->forall) {
    1381                                 auto mutParam = typeParam.get_and_mutate();
    1382                                 symtab.addType(mutParam);
    1383                                 for (auto & asst : mutParam->assertions) {
    1384                                         asst = fixObjectType(asst.strict_as<ast::ObjectDecl>(), symtab);
    1385                                         symtab.addId(asst);
    1386                                 }
    1387                                 typeParam = mutParam;
     1377                        mutType->forall.clear();
     1378                        mutType->assertions.clear();
     1379                        for (auto & typeParam : mutDecl->type_params) {
     1380                                symtab.addType(typeParam);
     1381                                mutType->forall.emplace_back(new ast::TypeInstType(typeParam->name, typeParam));
     1382                        }
     1383                        for (auto & asst : mutDecl->assertions) {
     1384                                asst = fixObjectType(asst.strict_as<ast::ObjectDecl>(), symtab);
     1385                                symtab.addId(asst);
     1386                                mutType->assertions.emplace_back(new ast::VariableExpr(functionDecl->location, asst));
    13881387                        }
    13891388
     
    14071406                        mutType->returns = std::move(returnTypes);
    14081407
     1408                        auto renamedType = strict_dynamic_cast<const ast::FunctionType *>(renameTyVars(mutType, RenameMode::GEN_EXPR_ID));
     1409
    14091410                        std::list<ast::ptr<ast::Stmt>> newStmts;
    14101411                        resolveWithExprs (mutDecl->withExprs, newStmts);
     
    14181419                        symtab.leaveScope();
    14191420
     1421                        mutDecl->type = renamedType;
    14201422                        mutDecl->mangleName = Mangle::mangle(mutDecl);
    14211423                        mutDecl->isTypeFixed = true;
     
    15341536        const PtrType * handlePtrType( const PtrType * type, const ast::SymbolTable & symtab ) {
    15351537                if ( type->dimension ) {
    1536                         #warning should use new equivalent to Validate::SizeType rather than sizeType here
    1537                         ast::ptr< ast::Type > sizeType = new ast::BasicType{ ast::BasicType::LongUnsignedInt };
     1538                        ast::ptr< ast::Type > sizeType = ast::sizeType;
    15381539                        ast::mutate_field(
    15391540                                type, &PtrType::dimension,
Note: See TracChangeset for help on using the changeset viewer.