Length restrictions of record of and set of can be hacked in Titan
Summary
If a length constrained set of or record of data element is given value indirectly, Titan does not detect the length violation.
Steps and/or TTCN-3 code to reproduce
type set of integer ISType;
type set length(2) of integer I2SType;
testcase setof_comp_without_arrays() runs on ct_empty{
var ISType v_myVarI;
var I2SType v_myArrayVar;
v_myVarI := { 3, 4 };
v_myArrayVar := v_myVarI; //this assignment is legal (length 2)
v_myVarI[2] := 5; //left side now has 3 elements
v_myArrayVar := v_myVarI; //and still acn be assigned to the length constrained set of
//v_myArrayVar := { 3, 4, 5 }; //this is an equivalent value assignment, which generates a compilation error.
}
What is the current bug behavior?
Test case runs smoothly.
What is the expected correct behavior?
error should be generated because of length violation.
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