1 /******************************************************************************
2 * Copyright (c) 2000-2016 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
13 ******************************************************************************/
19 type record twints // two ints
33 function f1( integer param1, boolean param2 := true )
35 // log( param1, param2 );
38 function f2( in template twints par )
42 testcase tc1() runs on C1
44 // f1(); // syntax error, param1 missing
45 f1( 1 ); // correct, param2=true
47 //~ f1( 1, true ); // same as above
48 // f1( 0, true, - ); // too many parameters
49 f1( 1, param2 := false );
52 This is _valid_ syntax but bad semantics
53 (unary minus cannot be applied to a record value)
56 //f1( { param1 := 1 } );
58 setverdict( pass ); // whew !
59 f2( /*par =*/ {13,14} );
62 testcase tc2() runs on C1
65 42,-,-,- // incomplete, other elements are unbound
67 var R1 r1 := { // value-list notation
73 var R1 r2 := { // assignment notation
79 var template R1 tr1 := { // value-list notation
85 var template R1 tr2 := { // assignment notation
92 error: Field `i1' cannot appear after field `i3'
93 var template R1 tr3 := { // assignment notation
102 Value-list notation and assignment notation cannot be mixed:
114 testcase tc3(integer i, float up) runs on C1
124 execute(tc3(1, 2.3)); // unnamed only
125 execute(tc3(i:=2, up:=0.0)); // named only
126 execute(tc3(3, up:=6.66)); // mix (regression test for TR925)