1 /******************************************************************************
2 * Copyright (c) 2000-2015 Ericsson Telecom AB
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 ******************************************************************************/
8 module TempRes_SE { //^In TTCN-3 module//
17 template (present) Rec t_original(in template (present) integer pt_i) := { //^Referenced template parameter is here$//2
18 i := pt_i, //^warning: Inadequate restriction on the referenced template parameter//2
19 f := ?, //^Referenced template is here$//
20 cs := ?, //^Referenced template is here$//2
21 os := ? //^Referenced template is here$//2
24 template (present) Rec t_modified(in template (present) integer pt_i, in template (present) float pt_f) //^Referenced template parameter is here$//
25 modifies t_original := {
26 f := pt_f //^warning: Inadequate restriction on the referenced template parameter//
29 function f_rec_temp(in template (value) Rec pt_rec_temp) {
33 template float t_f := (-10.0..-1.0); //^Referenced template is here$//
34 template charstring t_cs := ("abc", "def") ifpresent; //^Referenced template is here$//
36 function f_float_temp() return template (value) float { //^In function definition//
37 return t_f; //^In return statement// //^error: Restriction on return template does not allow usage of value range match$//
40 control { //^In control part//
41 var template (present) charstring vt_cs := "a";
43 var template integer vt_i := 3; //^Referenced template variable is here$//
45 f_rec_temp(t_modified(3, f_float_temp())); //^In function instance// //^In actual parameter list of function// \
46 //^In parameter #1 for// //^error: Restriction on template formal parameter does not allow usage of any value$//2
48 f_rec_temp(t_original(vt_i)); //^In function instance// //^In actual parameter list of function// \
49 //^In parameter #1 for//2 //^In actual parameter list of template// \
50 //^warning: Inadequate restriction on the referenced template variable// \
51 //^error: Restriction on template formal parameter does not allow usage of any value$//3
53 vt_cs := t_cs; //^In variable assignment:$// //^error: Restriction on template does not allow usage of \`ifpresent\'$//