File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -1303,6 +1303,8 @@ def visitField(self, field):
13031303 self .emit (" self().replace_expr(x->m_%s[i]);" % (field .name ), level )
13041304 self .emit (" current_expr = current_expr_copy_%d;" % (self .current_expr_copy_variable_count ), level )
13051305 self .current_expr_copy_variable_count += 1
1306+ elif field .type == "ttype" :
1307+ self .emit (" self().replace_%s(x->m_%s[i]);" % (field .type , field .name ), level )
13061308 self .emit ("}" , level )
13071309 else :
13081310 if field .type != "symbol" :
Original file line number Diff line number Diff line change @@ -3277,6 +3277,16 @@ class ReplaceWithFunctionParamVisitor: public ASR::BaseExprReplacer<ReplaceWithF
32773277 }
32783278 }
32793279
3280+ void replace_Struct (ASR::Struct_t *x) {
3281+ std::string derived_type_name = ASRUtils::symbol_name (x->m_derived_type );
3282+ ASR::symbol_t * derived_type_sym = current_scope->resolve_symbol (derived_type_name);
3283+ LCOMPILERS_ASSERT_MSG ( derived_type_sym != nullptr ,
3284+ " derived_type_sym cannot be nullptr" );
3285+ if (derived_type_sym != x->m_derived_type ) {
3286+ x->m_derived_type = derived_type_sym;
3287+ }
3288+ }
3289+
32803290 ASR::ttype_t * replace_args_with_FunctionParam (ASR::ttype_t * t, SymbolTable* current_scope) {
32813291 this ->current_scope = current_scope;
32823292
You can’t perform that action at this time.
0 commit comments