OOP-Private member functions in multiple classes are conflicting
Submitted by Elemer Lelik
Link to original bug (#568694)
Description
The below code
/***************************************************************** ** @author STF 572 ** @version 0.0.1 ** @purpose 5.1.1.9, Ensure that private member functions are not visible and can be present in multiple classes of the same hierarchy with different parameter lists and return values. ** @verdict pass accept *****************************************************************/
module Sem_5010109_Visibility_001 "TTCN-3:2018 Object-Oriented" {
type component GeneralComp {
}
type class MySuperClass {
var integer v_i;
private function f_do(integer v_i) return integer {
return this.v_i + v_i;
}
}
type class MySubClass extends MySuperClass {
private function f_do() {
log("Do nothing!!! (Visibility)");
}
}
testcase TC_Sem_5010109_Visibility_001() runs on GeneralComp {
var MySubClass v_a := MySubClass.create(32) //: MySuperClass(); FIXME!!!
setverdict(pass);
}
control {
execute(TC_Sem_5010109_Visibility_001());
}
}
returns an error when compiling:
:
Sem_5010109_Visibility_001.ttcn:20.5-25.5: In type definition MySubClass': Sem_5010109_Visibility_001.ttcn:22.17-24.9: error: The prototype of method
f_do' is not identical to that of inherited method `@Sem_5010109_Visibility_001.MySuperClass.f_do'
:
Version: 7.1.0