diff --git a/compiler2/Type_codegen.cc b/compiler2/Type_codegen.cc index b701570f640c9167557fccf4bb1f852b7a74b3b7..1f277cdb87c9915aa3c100ab4fef03cc5f2f4360 100644 --- a/compiler2/Type_codegen.cc +++ b/compiler2/Type_codegen.cc @@ -237,8 +237,10 @@ void Type::generate_code_embedded_after(output_struct *target) case T_TESTCASE: { size_t nof_params = u.fatref.fp_list->get_nof_fps(); for(size_t i = 0; i < nof_params; i++) { - u.fatref.fp_list->get_fp_byIndex(i)->get_Type() - ->generate_code(target); + Ttcn::FormalPar* fp = u.fatref.fp_list->get_fp_byIndex(i); + if (fp->get_asstype() != Assignment::A_PAR_TIMER) { + fp->get_Type()->generate_code(target); + } } break; } default: diff --git a/regression_test/functionReference/FuncRef.ttcn b/regression_test/functionReference/FuncRef.ttcn index 5a90781ca6914f2853dde1dbeecb88bdb7aa56d3..808b33a91af50cc1ec3c84ce18cca1e1a3ab8041 100644 --- a/regression_test/functionReference/FuncRef.ttcn +++ b/regression_test/functionReference/FuncRef.ttcn @@ -38,6 +38,12 @@ type function my_int2str_type(in integer a) return charstring; modulepar my_int2str_type modulepar_my_intstr := refers(my_int2str); +function f_timer(timer t) return charstring { + return log2str(t); +} + +type function f_timer_type(timer t) return charstring; + type union operator_type { @@ -462,6 +468,19 @@ testcase tc_modulepar_refer() runs on FuncRef_comp { } } +// for bug 546800 +testcase tc_function_with_timer() runs on FuncRef_comp { + var f_timer_type f := refers(f_timer); + timer t1; + var charstring res := f.apply(t1); + if (res == "timer: { name: t1, default duration: none, state: inactive }") { + setverdict(pass); + } + else { + setverdict(fail, res); + } +} + control { @@ -485,6 +504,7 @@ control execute(tc_functionrefIsbound()); execute(tc_send_tc()); execute(tc_modulepar_refer()); + execute(tc_function_with_timer()); } }