Titan does not check MTC compatibility even in runtime
Summary
Compilation and even execution does not fail if a function is called with an mtc clause incompatible with the actual type of the mtc. Also, mtc type compatibility shall be handled as described in Section 6.3.3, part 3 of the standard.
Steps and/or TTCN-3 code to reproduce
testcase mtc_comp() runs on ct_empty{
var narrow ptc := narrow.create;
ptc.start(fn_mtc_comp());
all compone`nt.done;
setverdict(pass);
}
function fn_mtc_comp() runs on narrow mtc narrow{
//connect(self:P,mtc:P);
setverdict(pass);
}
What is the current bug behavior?
The above code compiles and passes, while it shall not as empty_ct is incompatible with narrow. With the connect operation it fails, as ct_empty does not have a port P.
What is the expected correct behavior?
Compilation shall fail.
Beware after correcting as Titan does not handle component type compatibility as described in the standard (see 2 latest tickets by me: #654 and #653). So after correcting, make sure that this code passes:
testcase mtc_comp() runs on broad{
var narrow ptc := narrow.create;
ptc.start(fn_mtc_comp());
all component.done;
setverdict(pass);
}
function fn_mtc_comp() runs on narrow mtc narrow{
connect(self:P,mtc:P);
setverdict(pass);
}
Right now this passes, but if the compatibility of the runs on clause of the test case was examined with the mtc clause of the function in compile time (with the current implementation of component compatibility), it would fail. However, it should not as narrow is compatible to broad according to the standard without broad being narrow's extension
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