Merge github.com:eclipse/titan.core
[deliverable/titan.core.git] / function_test / Semantic_Analyser / xer / untag2_SE.ttcn
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
7 *
8 * Contributors:
9 * Balasko, Jeno
10 * Raduly, Csaba
11 *
12 ******************************************************************************/
13 module untag2 { //^In TTCN-3 module `untag2'://
14
15 type record u2 { //^In type definition//
16 integer i, //^Due to this UNTAGGED component//
17 charstring s, //^error: More than one UNTAGGED character-encodable field// \
18 //^error: All the other components should be ATTRIBUTE or ANY-ATTRIBUTE//
19 universal charstring u //^error: More than one UNTAGGED character-encodable field//
20 }
21 with {
22 variant (i, s, u) "untagged"
23 }
24
25
26 type record u3 {
27 record of integer f1,
28 record of integer f2
29 }
30 with {
31 variant (f1,f2) "untagged"; // this can not be decoded! TODO: add diagnostic
32 }
33
34 type record u4 {
35 record {} f1
36 }
37 with {
38 // untagged + "name as" is rather redundant,
39 // but the compiler doesn't report it
40 variant (f1) "untagged"
41 variant (f1) "name as 'f2'"
42 }
43
44 }
45 with {
46 encode "XML";
47 }
This page took 0.033005 seconds and 5 git commands to generate.