Titan Core Initial Contribution
[deliverable/titan.core.git] / function_test / Semantic_Analyser / xer / recur_SE.ttcn
1 /******************************************************************************
2 * Copyright (c) 2000-2014 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 module recur { //^In TTCN-3 module `recur'://
9
10 type foo foo //^In type definition// \
11 //^error: While checking attributes: Circular reference: `@recur.foo' -> `@recur.foo'//
12 with { variant "name as 'Foo'" }
13
14 type record R1 {
15 integer f1,
16 R1 f2 optional // optional saves the day
17 }
18
19 // TR 949 = HM93077. This infinite recursion is not detected.
20 // (Should be a compiler error, it is impossible to write a value for it)
21 // C++ code generated from it cannot be compiled.
22 type union no_choice { //In type definition// \
23 //While checking embedded recursions: Circular reference://2
24 no_choice n1,
25 no_choice n2
26 }
27
28 // This is recursion can be broken
29 type union pro_choice {
30 pro_choice n1,
31 pro_choice n2,
32 boolean n3
33 }
34
35 const pro_choice nc := {
36 n1 := {
37 n2 := {
38 n1 := {
39 n3 := true
40 }
41 }
42 }
43 }
44
45 }
46 with {
47 encode "XML"
48 }
This page took 0.03297 seconds and 5 git commands to generate.