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 ******************************************************************************/
13 type record twints // two ints
27 function f1( integer param1, boolean param2 := true )
29 // log( param1, param2 );
32 function f2( in template twints par )
36 testcase tc1() runs on C1
38 // f1(); // syntax error, param1 missing
39 f1( 1 ); // correct, param2=true
41 //~ f1( 1, true ); // same as above
42 // f1( 0, true, - ); // too many parameters
43 f1( 1, param2 := false );
46 This is _valid_ syntax but bad semantics
47 (unary minus cannot be applied to a record value)
50 //f1( { param1 := 1 } );
52 setverdict( pass ); // whew !
53 f2( /*par =*/ {13,14} );
56 testcase tc2() runs on C1
59 42,-,-,- // incomplete, other elements are unbound
61 var R1 r1 := { // value-list notation
67 var R1 r2 := { // assignment notation
73 var template R1 tr1 := { // value-list notation
79 var template R1 tr2 := { // assignment notation
86 error: Field `i1' cannot appear after field `i3'
87 var template R1 tr3 := { // assignment notation
96 Value-list notation and assignment notation cannot be mixed:
108 testcase tc3(integer i, float up) runs on C1
118 execute(tc3(1, 2.3)); // unnamed only
119 execute(tc3(i:=2, up:=0.0)); // named only
120 execute(tc3(3, up:=6.66)); // mix (regression test for TR925)