Ports are not strongly typed in Titan
Summary
Ports should be strongly typed according to Section 6.3.4 of the TTCN-3 standard.
Steps and/or TTCN-3 code to reproduce
type integer integeralias;
type port mypts message{
inout integer;
}with{extension "internal";}
type port myptr message{
inout integeralias;
}with{extension "internal";}
type component synasync{
port mypts AS;
port myptr AR;
}
function comm_comp_f() runs on synasync{
var integer via := 10;
var floatalias vfa := 1.0;
var booleanalias vba := false;
var octetstringalias voa := ''O;
AR.receive(integer:?); //error
setverdict(pass);
}
testcase comm_comp() runs on synasync{
var synasync ptc := synasync.create;
connect(self:S, ptc:R); //error -- incompatible ports
ptc.start(comm_comp_f());
var integeralias via := 1;
AS.send(via);
}
What is the current bug behavior?
Pass
What is the expected correct behavior?
Error due to the indicated rows. If the connect operation produces an error already, try this slightly modified code for proceeding:
type integer integeralias;
type port mypt message{
inout integer, integeralias;
}with{extension "internal";}
type component synasync{
port mypt A;
}
function comm_comp_f() runs on synasync{
var integer via := 10;
var floatalias vfa := 1.0;
var booleanalias vba := false;
var octetstringalias voa := ''O;
A.receive(integer:?); //error
setverdict(pass);
}
testcase comm_comp() runs on synasync{
var synasync ptc := synasync.create;
connect(self:A, ptc:A); //no error -- compatible ports, as both types have inout direction
ptc.start(comm_comp_f());
var integeralias via := 1;
A.send(via);
}
This should run into an error at the receive operation as it is expecting an integer but getting an integeralias data element.
Synchronous ports have to have strong type compatibility, but the standard does not specify this exactly, so waiting for answer on this from ETSI.
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