Clashing enumerated identifiers unrecognized by Titan
Summary
According to sections 6.2.4 and 8.2.3.1 of the TTCN-3 standard, the identifier of a data element with an enumerated type cannot be identical to any element of the domain of the given enumerated type. For example, in the below example enumY cannot be the identifier of a MyEnumType variable for the following reason: When assigning enumY as the value of another MyEnumType variable enumW, it is ambiguous whether the value of variable enumY (which is enumX) or the emunerated domain value enumY is intended to be assigned to enumW.
Steps and/or TTCN-3 code to reproduce
import from A all;
const MyEnumType2 enumX := enumY;// this is allowed as MyEnumtype2 does not contain enumX
testcase clashing_enum_value() runs on ct_empty{
var MyEnumType enumY := enumX; // this is not allowed as enumerated values restrict global names (see clause 6.2.4)
var MyEnumType enumW := enumY;
var MyEnumType enumZ;
enumZ := enumX; // allowed as MyEnumType does not contain enumZ and also, enumX resolves to domain element of type MyEnumType
//enumZ := modules.enumX; //ERROR but due to this resolving to local constant enumX, which is the expected behavior
setverdict(pass);
}
module A {
friend module modules;
type enumerated MyEnumType {enumX, enumY}
type enumerated MyEnumType2 {enumY, enumZ}
}
What is the current bug behavior?
pass
What is the expected correct behavior?
error
Relevant logs and/or screenshots
Possible fixes
Titan version
8.1.0
Platform details (OS type and version)
Microsoft Windows 10 Enterprise 10.0.19042
/cc @aknappqwt @mmagyari
Edited by Levente Erős