Home » Eclipse Projects » Eclipse Titan » Compiler error on in-line template as parameter of a function(TTCN-3 Compiler In-line template)
Compiler error on in-line template as parameter of a function [message #1859307] |
Tue, 30 May 2023 10:39 |
Yann Garcia Messages: 145 Registered: June 2016 |
Senior Member |
|
|
Dear Support,
I got a compiler error (see below) when passing an inline template declaration as an argument of TTCN-3 function:
f_Iot_Diameter_receive(
{
DIAMETER_MSG:{uDR_MSG := mw_UDR_userData_publicIdentity("tel:"&v_userInfoA.publicId)}
},
{},
{0, omit},
"TP_SH_HSS_UDA_01 - UDR",
p_forward_to_mtc,
p_checkMessage
)
The inline template declaration is:
DIAMETER_MSG:{uDR_MSG := mw_UDR_userData_publicIdentity("tel:"&v_userInfoA.publicId)}
The compiler error is:
./ttcn/AtsImsIot/AtsImsIot_TP_behavior_SH.ttcn:90:37: error: at or before token `:': syntax error, unexpected ':', expecting ',' or '}'
Notify: Parsing TTCN-3 module `./ttcn/AtsImsIot/AtsImsIot_TD_DRG.ttcn'...
My understanding of ETSI ES 201 873-1 clause 15.4 In-line Templates is that inline template usage is not limited to port operation such a send or receive.
Is it correct?
Many thanks in advance for your help,
BR\Yann Garia
|
|
| |
Re: Compiler error on in-line template as parameter of a function [message #1859337 is a reply to message #1859313] |
Wed, 31 May 2023 16:05 |
Botond Baranyi Messages: 55 Registered: February 2016 |
Member |
|
|
Hi Yann,
there is pair of curly brackets around the mentioned in-line template, meaning it is supposed to be a field of a record or an element in an array.
In-line templates work for function parameters in TITAN, but only if the entire actual parameter is an in-line template (i.e. the type indicator is in front of the whole actual parameter, not in front of a field or element).
You could write this instead (without the curly brackets), or replace DIAMETER_MSG with the parent structure, if it really is a field or element:
f_Iot_Diameter_receive(
DIAMETER_MSG:{uDR_MSG := mw_UDR_userData_publicIdentity("tel:"&v_userInfoA.publicId)},
{},
{0, omit},
"TP_SH_HSS_UDA_01 - UDR",
p_forward_to_mtc,
p_checkMessage
)
Best regards,
Botond Baranyi
|
|
| | | | |
Re: Compiler error on in-line template as parameter of a function [message #1859369 is a reply to message #1859350] |
Fri, 02 June 2023 15:23 |
Botond Baranyi Messages: 55 Registered: February 2016 |
Member |
|
|
Hello Yann,
I don't think it'll be implemented anytime soon.
As a workaround you can simply omit the type indicator before these templates (that is, use regular templates instead of in-line templates).
Such as:
var template DIAMETER_MSG mw_diameter_msg := {mAR_MSG := mw_MAR(mw_publicIdentity(v_publicIdentity))};
Or:
f_Iot_Diameter_receive(
{
{uDR_MSG := mw_UDR_userData_publicIdentity("tel:"&v_userInfoA.publicId)}
},
{},
{0, omit},
"TP_SH_HSS_UDA_01 - UDR",
p_forward_to_mtc,
p_checkMessage
)
The type of a variable or a function parameter is not ambiguous, so there's no reason to specify its type again on the right-hand-side, or in the actual parameter value.
Best regards,
Botond Baranyi
|
|
| |
Goto Forum:
Current Time: Mon Oct 14 21:03:46 GMT 2024
Powered by FUDForum. Page generated in 0.05949 seconds
|