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
9 * Adrien Kirjak – initial implementation
12 ** @purpose 1:15.6.5, Ensure that template variables does not allow referencing alternatives inside an union with complemented list
13 ** @verdict pass reject
14 *****************************************************************/
17 /*referencing an alternative of a union template
18 or template field to which Omit, AnyValueOrNone, a template list or a complemented list is assigned, at the right hand side of an assignment, shall cause an error.*/
21 module NegSem_150605_Referencing_union_alternatives_004 {
28 type record ExampleType { // Exampletype record with union
33 type component GeneralComp { }
35 testcase TC_NegSem_150605_Referencing_union_alternatives_004() runs on GeneralComp {
37 var template ExampleType m_template;
38 var template integer m_template_2;
40 //assign values to template:
43 m_template.b.u1:=complement(1,2);
44 //m_template.b.u2:=2.0;
46 m_template_2 := m_template.b.u1; //error: complement value list
53 execute(TC_NegSem_150605_Referencing_union_alternatives_004());