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
12 ******************************************************************************/
13 module SemanticCheck {
15 // Recursive type checks (type Inner doesn't have JSON encoding explicitly,
16 // but it can be encoded as part of Outer1)
29 external function f_enc1(in Outer1 x) return octetstring
30 with { extension "prototype(convert) encode(JSON)" }
32 // Same thing, but Outer2 only has a JSON variant attribute to specify the encoding (no 'encode' attribute)
37 variant(rec) "JSON : name as stuff";
40 external function f_enc2(in Outer2 x) return octetstring
41 with { extension "prototype(convert) encode(JSON)" }
43 // Embedded union with the "as value" attribute
55 type union EmbeddedUnion
61 variant "JSON: as value";