Union compatibility is more restrictive in Titan than in TTCN-3 standard
Summary
Titan requires type equality of union types, instead of field name and field type level compatibiity of the selected type. See code for details.
Steps and/or TTCN-3 code to reproduce
type union U1 {integer i};
type union U2 {integer i, boolean b};
testcase union_comp() runs on ct_empty{
var U1 v_u1 := {i := 1};
var U2 v_u2 := v_u1; //correct as all alternatives of U1 exist in U2, Titan: Error
v_u1:= v_u2; //correct as the alternative i is selected in v_u2 and is compatible to i in U1, Titan: Error
}
What is the current bug behavior?
See above
What is the expected correct behavior?
Test case should run smoothly.
Relevant logs and/or screenshots
../src/datatypes.ttcn:638.10-21: In variable definition `v_u2':
../src/datatypes.ttcn:638.18-21: error: Type mismatch: a value of type `@datatypes.U2' was expected instead of `@datatypes.U1'
../src/datatypes.ttcn:639.3-13: In variable assignment:
../src/datatypes.ttcn:639.10-13: error: Type mismatch: a value of type `@datatypes.U1' was expected instead of `@datatypes.U2'
Possible fixes
Titan version
8.1.0
Platform details (OS type and version)
Microsoft Windows 10 Enterprise 10.0.19042
/cc @aknappqwt @mmagyari