System component type compatibility is not checked at all by Titan
Summary
A function with a system clause can be started in a context where the component type in the system clause of the test case is incompatible with that in that of the function. This is wrong according to Section 6.3.3, point 4 of the TTCN-3 standard.
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 system_comp() runs on broad system ct_empty{
var narrow ptc := narrow.create;
ptc.start(fn_system_comp());
all component.done;
setverdict(pass);
}
function fn_system_comp() runs on narrow system narrow{
connect(self:P,mtc:P);
setverdict(pass);
}
What is the current bug behavior?
The above compiles, and passes.
What is the expected correct behavior?
Compilation should fail, as system type (defined by the test case) is ct_empty, and the function started in the context created by the test case requires a system of type narrow, which is incompatible with ct_empty. So this compatibility should be checked.
Watch out! After fixing this issue, make sure that the component type compatibility is checked according to Section 6.3.3 of the standard (this is referred to from tickets #654, #653, and #652 (closed) as well). After fixing, make sure that the following code does not lead to error, but passes:
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 system_comp() runs on broad system broad{
var narrow ptc := narrow.create;
ptc.start(fn_system_comp());
all component.done;
setverdict(pass);
}
function fn_system_comp() runs on narrow system narrow{
connect(self:P,mtc:P);
setverdict(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 @mmagyari