Commit ff3c932d authored by Botond Baranyi's avatar Botond Baranyi
Browse files

OOP: functions and external functions now count as identical when checking...


OOP: functions and external functions now count as identical when checking overriding methods in classes (Bug 568899)
Signed-off-by: Botond Baranyi's avatarBotond Baranyi <botond.baranyi@ericsson.com>
Change-Id: I6bb317a5a9361024c0fb4da304126acf43bc80e0
parent 093e367e
...@@ -6809,10 +6809,18 @@ namespace Ttcn { ...@@ -6809,10 +6809,18 @@ namespace Ttcn {
bool Def_Function_Base::is_identical(Def_Function_Base* p_other) bool Def_Function_Base::is_identical(Def_Function_Base* p_other)
{ {
if (asstype != p_other->get_asstype()) { 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; return false;
} }
else if (return_type != NULL && }
if (return_type != NULL &&
!p_other->return_type->is_identical(return_type)) { !p_other->return_type->is_identical(return_type)) {
return false; return false;
} }
......
...@@ -482,6 +482,11 @@ type class C48 extends C47 { //^In type definition// ...@@ -482,6 +482,11 @@ type class C48 extends C47 { //^In type definition//
function m4() { } //Cannot override final method `@oop_SE.C47.m4'// 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// function f_of_operator() { //^In function definition//
var C0 x := C0.create; var C0 x := C0.create;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment