Component type compatibility is too strict in Titan
Summary
Component type compatibility requires exact type match (or the assigned type being the parent of the type of assignee), while section 6.3.3, case 1) of the TTCN-3 standard is more relaxed.
Steps and/or TTCN-3 code to reproduce
type component ct_empty{}
type port mypt message{
inout integer
}with{extension "internal"}
type component broad{
port mypt P;
port mypt Q;
var integer i:=1;
var integer j:=2;
timer T:=3.0;
}
type component narrow{
port mypt P;
var integer i:=1;
timer T:=3.0;
}
testcase comp_compatibility() runs on empty_ct{
var broad b := broad.create;
var narrow n := narrow.create;
n:=b;
}
What is the current bug behavior?
Compilation fails as n and b are of different types. If the two types are constructed as parent and extension, the assignment works though:
type component broad extends narrow{
port mypt Q;
var integer j:=2;
}
type component narrow{
port mypt P;
var integer i:=1;
timer T:=3.0;
}
What is the expected correct behavior?
Compilation should be successful.
Relevant logs and/or screenshots
``` ../src/assignments.ttcn:559.6: error: Type mismatch: a value of type @assignments.narrow' was expected instead of
@assignments.broad'
## 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