Enumerated domain elements with integer value range/list cannot be defined and used
Summary
According to the TTCN-3 standard (section 6.2.4) when assigning integer identifiers to enumerated type domain elements, assigning a single integer as identifier is not the only legal case. It is also legal to define a set of integers for the given enumerated type domain element. Titan however, only supports the former case.
Steps and/or TTCN-3 code to reproduce
Use this code in a new module:
type enumerated MyThirdEnumType {
Blue(0),
Yellow(1),
Green(3),
Other(2, 4..255)
}
testcase enum_list() runs on ct_empty{
var MyThirdEnumType v_color := Other(5);
if (v_color == Other(4)) {}
if (v_color > Other(4)) {}
if (match(v_color, Other(?))) {}
if (match(v_color, Other(6..10))) {}
if (match(v_color, Other((6..10), 15, 20..25))) {}
setverdict(pass);
}
What is the current bug behavior?
This will not compile
What is the expected correct behavior?
How it should work on the other hand, is:
- any enum value defnied with a set of integers as identifier shall be referred to with its name and the chosen identifier in parentheses. Other(4) and Other(5) shall be handled as different values of the same type.
- such enum values shall also be usable as templates (like in the bottom 3 examples).
Thus, the above code should not cause errors, the testcase should pass.
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