Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Concurrency/Keywords.cc

    r2db79e5 rba3706f  
    257257        // Generic keyword implementation
    258258        //=============================================================================================
    259         void fixupGenerics(FunctionType * func, StructDecl * decl) {
    260                 cloneAll(decl->parameters, func->forall);
    261                 for ( TypeDecl * td : func->forall ) {
    262                         strict_dynamic_cast<StructInstType*>(
    263                                 func->parameters.front()->get_type()->stripReferences()
    264                         )->parameters.push_back(
    265                                 new TypeExpr( new TypeInstType( noQualifiers, td->name, td ) )
    266                         );
    267                 }
    268         }
    269 
    270259        void ConcurrentSueKeyword::postvisit(StructDecl * decl) {
    271260                if( decl->name == type_name && decl->body ) {
     
    312301                );
    313302
    314                 get_type->get_parameters().push_back( this_decl->clone() );
     303                get_type->get_parameters().push_back( this_decl );
    315304                get_type->get_returnVals().push_back(
    316305                        new ObjectDecl(
     
    329318                        )
    330319                );
    331                 fixupGenerics(get_type, decl);
    332320
    333321                FunctionDecl * get_decl = new FunctionDecl(
     
    355343                                nullptr
    356344                        );
    357                         fixupGenerics(main_type, decl);
    358                 }
    359 
    360                 delete this_decl;
     345                }
    361346
    362347                declsToAddBefore.push_back( forward );
     
    392377                                        new MemberExpr(
    393378                                                field,
    394                                                 new CastExpr(
    395                                                         new VariableExpr( func->get_functionType()->get_parameters().front() ),
    396                                                         func->get_functionType()->get_parameters().front()->get_type()->stripReferences()->clone()
    397                                                 )
     379                                                UntypedExpr::createDeref( new VariableExpr( func->get_functionType()->get_parameters().front() ) )
    398380                                        )
    399381                                )
Note: See TracChangeset for help on using the changeset viewer.