/******************************************************************************
 * Copyright (c) 2000-2025 Ericsson Telecom AB
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v2.0
 * which accompanies this distribution, and is available at
 * https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html
 *
 * Contributors:
 *   Baranyi, Botond
 *
 ******************************************************************************/
module MixedNotation_SE { //^In TTCN-3 module//

type record Rec {
  integer field1,
  charstring field2,
  boolean field3,
  float field4
}

type set Sec {
  integer field1,
  charstring field2,
  boolean field3,
  float field4
}

type record of integer RoI; //^In component//2

type set of integer SoI; //^In component//2

type integer Arr[1..4]; //^In array element//2

const Rec c_rec1 := { 1, field3 := true }; //^In constant definition// //Field `field2' is missing from record value// //Field `field4' is missing from record value//
const Rec c_rec2 := { 1, "a", field3 := true, field4 := -1.0 };
const Rec c_rec3 := { 1, "a", field4 := -1.0, field3 := true }; //^In constant definition// //Field `field3' cannot appear after field `field4' in record value//
const Rec c_rec4 := { 1, field2 := "a", field3 := true, field4 := -1.0 };
const Rec c_rec5 := { 1, field2 := "a", field3 := true, field1 := 2 }; //^In constant definition// //Duplicate record field `field1'// //Field `field1' is already given here// //Field `field4' is missing from record value//

const Sec c_set1 := { 1, field3 := true }; //^In constant definition// //Field `field2' is missing from set value// //Field `field4' is missing from set value//
const Sec c_set2 := { 1, "a", field3 := true, field4 := -1.0 };
const Sec c_set3 := { 1, "a", field4 := -1.0, field3 := true };
const Sec c_set4 := { 1, field2 := "a", field3 := true, field4 := -1.0 };
const Sec c_set5 := { 1, field2 := "a", field3 := true, field1 := 2 }; //^In constant definition// //Duplicate set field `field1'// //Field `field1' is already given here// //Field `field4' is missing from set value//

const RoI c_roi1 := { 1, [2] := 3 }; //^In constant definition// //It's not allowed to create hole\(s\) in constant values//
const RoI c_roi2 := { 1, [1] := 3 };
const RoI c_roi3 := { 1, 2, [3] := 4, [2] := 3 };
const RoI c_roi4 := { 1, 2, [3] := 4, [1] := 3 }; //^In constant definition// //An integer value greater than or equal to `2` was expected for indexing type `@MixedNotation_SE.RoI' instead of `1'//

const SoI c_soi1 := { 1, [2] := 3 }; //^In constant definition// //It's not allowed to create hole\(s\) in constant values//
const SoI c_soi2 := { 1, [1] := 3 };
const SoI c_soi3 := { 1, 2, [3] := 4, [2] := 3 };
const SoI c_soi4 := { 1, 2, [3] := 4, [1] := 3 }; //^In constant definition// //An integer value greater than or equal to `2` was expected for indexing type `@MixedNotation_SE.SoI' instead of `1'//

const Arr c_arr1 := { 1, 2, [4] := 3 }; //^In constant definition// //It's not allowed to create hole\(s\) in constant values//
const Arr c_arr2 := { 1, 2, [3] := 3 }; //^In constant definition// //It's not allowed to create hole\(s\) in constant values//
const Arr c_arr3 := { 1, 2, [4] := 4, [3] := 3 };
const Arr c_arr4 := { 1, 2, [3] := 4, [2] := 3 }; //^In constant definition// //An integer value greater than or equal to `3` was expected for indexing type `integer\[1..4\]' instead of `2'//

function f() { //^In function definition//
  var Rec v_rec1 := { 1, field3 := true };
  var Rec v_rec2 := { 1, "a", field3 := true, field4 := -1.0 };
  var Rec v_rec3 := { 1, "a", field4 := -1.0, field3 := true }; //^In variable definition// //Field `field3' cannot appear after field `field4' in record value//
  var Rec v_rec4 := { 1, field2 := "a", field3 := true, field4 := -1.0 };
  var Rec v_rec5 := { 1, field2 := "a", field3 := true, field1 := 2 }; //^In variable definition// //Duplicate record field `field1'// //Field `field1' is already given here//

  var Sec v_set1 := { 1, field3 := true };
  var Sec v_set2 := { 1, "a", field3 := true, field4 := -1.0 };
  var Sec v_set3 := { 1, "a", field4 := -1.0, field3 := true };
  var Sec v_set4 := { 1, field2 := "a", field3 := true, field4 := -1.0 };
  var Sec v_set5 := { 1, field2 := "a", field3 := true, field1 := 2 }; //^In variable definition// //Duplicate set field `field1'// //Field `field1' is already given here//

  var RoI v_roi1 := { 1, [2] := 3 };
  var RoI v_roi2 := { 1, [1] := 3 };
  var RoI v_roi3 := { 1, 2, [3] := 4, [2] := 3 };
  var RoI v_roi4 := { 1, 2, [3] := 4, [1] := 3 }; //^In variable definition// //An integer value greater than or equal to `2` was expected for indexing type `@MixedNotation_SE.RoI' instead of `1'//

  var SoI v_soi1 := { 1, [2] := 3 };
  var SoI v_soi2 := { 1, [1] := 3 };
  var SoI v_soi3 := { 1, 2, [3] := 4, [2] := 3 };
  var SoI v_soi4 := { 1, 2, [3] := 4, [1] := 3 }; //^In variable definition// //An integer value greater than or equal to `2` was expected for indexing type `@MixedNotation_SE.SoI' instead of `1'//

  var Arr v_arr1 := { 1, 2, [4] := 3 };
  var Arr v_arr2 := { 1, 2, [3] := 3 };
  var Arr v_arr3 := { 1, 2, [4] := 4, [3] := 3 };
  var Arr v_arr4 := { 1, 2, [3] := 4, [2] := 3 }; //^In variable definition// //An integer value greater than or equal to `3` was expected for indexing type `integer\[1..4\]' instead of `2'//
}

}
