OOP-fields cannot be declared public
Submitted by Elemer Lelik
Link to original bug (#568755)
Description
The below code
/***************************************************************** ** @author STF 572 ** @version 0.0.1 ** @purpose 5.1.1.9, Ensure that fields can be declared as private or protected only. ** @verdict pass reject *****************************************************************/ module NegSem_5010109_Visibility_001 "TTCN-3:2018 Object-Oriented" {
type component GeneralComp {
}
type class MyClass {
public var integer v_i; // not allowed should not compile!!! FIXME!!!
}
testcase TC_NegSem_5010109_Visibility_001() runs on GeneralComp {
var MyClass v_a := MyClass.create(1);
if (v_a.v_i == 1) {
setverdict(pass);
} else {
setverdict(fail);
}
}
control {
execute(TC_NegSem_5010109_Visibility_001());
}
}
should not compile.
Version: 7.1.0