OOP-reusing identifiers of members
Submitted by Elemer Lelik
Link to original bug (#568714)
Description
The below code snippet should not compile:
/***************************************************************** ** @author STF 572 ** @version 0.0.1 ** @purpose 5.1.1.1, Ensure that reusing identifiers of members of the component type specified in the runs on clause of the class for members and inside methods for formal parameters and local declarations is not allowed ** @verdict pass reject *****************************************************************/
module NegSem_5010101_scopeRules_001 "TTCN-3:2018 Object-Oriented" {
type component GeneralComp {
const integer c_i := 5;
}
public type class MyClass runs on GeneralComp {
const integer c_i := 8; //not allowed
function DoNothing(integer c_i := 11) { //not allowed
log("Not allowed this type of reusing IDs.");
}
}
//...
}
Version: 7.1.0