diff --git a/compiler2/ttcn3/AST_ttcn3.cc b/compiler2/ttcn3/AST_ttcn3.cc index 8c86d4ac621bb8990f27c8582b51c7954b8b43eb..0bbdd64758e899e13a5bad27357cb42c70aad127 100644 --- a/compiler2/ttcn3/AST_ttcn3.cc +++ b/compiler2/ttcn3/AST_ttcn3.cc @@ -6809,11 +6809,19 @@ namespace Ttcn { bool Def_Function_Base::is_identical(Def_Function_Base* p_other) { - if (asstype != p_other->get_asstype()) { - return false; + Common::Assignment::asstype_t asstype2 = p_other->get_asstype(); + if (asstype != asstype2) { + if ((asstype == Common::Assignment::A_FUNCTION && asstype2 != Common::Assignment::A_EXT_FUNCTION) || + (asstype == Common::Assignment::A_EXT_FUNCTION && asstype2 != Common::Assignment::A_FUNCTION) || + (asstype == Common::Assignment::A_FUNCTION_RVAL && asstype2 != Common::Assignment::A_EXT_FUNCTION_RVAL) || + (asstype == Common::Assignment::A_EXT_FUNCTION_RVAL && asstype2 != Common::Assignment::A_FUNCTION_RVAL) || + (asstype == Common::Assignment::A_FUNCTION_RTEMP && asstype2 != Common::Assignment::A_EXT_FUNCTION_RTEMP) || + (asstype == Common::Assignment::A_EXT_FUNCTION_RTEMP && asstype2 != Common::Assignment::A_FUNCTION_RTEMP)) { + return false; + } } - else if (return_type != NULL && - !p_other->return_type->is_identical(return_type)) { + if (return_type != NULL && + !p_other->return_type->is_identical(return_type)) { return false; } FormalParList* other_fp_list = p_other->get_FormalParList(); diff --git a/function_test/Semantic_Analyser/oop/oop_SE.ttcn b/function_test/Semantic_Analyser/oop/oop_SE.ttcn index d3494c3cfa26b2dd83b6f4d84d10245ed042265b..b5a49e641ad9697a8633d0b3d7b34accd6825637 100644 --- a/function_test/Semantic_Analyser/oop/oop_SE.ttcn +++ b/function_test/Semantic_Analyser/oop/oop_SE.ttcn @@ -482,6 +482,11 @@ type class C48 extends C47 { //^In type definition// function m4() { } //Cannot override final method `@oop_SE.C47.m4'// } +type class C49 extends C40 { + function f1(in integer p) return octetstring { return int2oct(p, 2); } + function f2() { } +} + function f_of_operator() { //^In function definition// var C0 x := C0.create;