blob: e6376f551f13d4bcc44ac62d52123ad4a3c56808 [file] [log] [blame]
Jens Geyerae0b22c2014-09-04 23:04:21 +02001/*
2 * Licensed to the Apache Software Foundation (ASF) under one
3 * or more contributor license agreements. See the NOTICE file
4 * distributed with this work for additional information
5 * regarding copyright ownership. The ASF licenses this file
6 * to you under the Apache License, Version 2.0 (the
7 * "License"); you may not use this file except in compliance
8 * with the License. You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing,
13 * software distributed under the License is distributed on an
14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 * KIND, either express or implied. See the License for the
16 * specific language governing permissions and limitations
17 * under the License.
18 *
19 * Contains some contributions under the Thrift Software License.
20 * Please see doc/old-thrift-license.txt in the Thrift distribution for
21 * details.
22 */
23
24enum MyEnum1 {
25 ME1_0 = 0,
26 ME1_1 = 1,
27 ME1_2,
28 ME1_3,
29 ME1_5 = 5,
30 ME1_6,
31}
32
33enum MyEnum2 {
34 ME2_0,
35 ME2_1,
36 ME2_2,
37}
38
39enum MyEnum3 {
40 ME3_0,
41 ME3_1,
42 ME3_N2 = -2,
43 ME3_N1,
44 ME3_D0,
45 ME3_D1,
46 ME3_9 = 9,
47 ME3_10,
48}
49
50enum MyEnum4 {
51 ME4_A = 0x7ffffffd
52 ME4_B
53 ME4_C
54 // attempting to define another enum value here fails
55 // with an overflow error, as we overflow values that can be
56 // represented with an i32.
57}
58
59enum MyEnum5 {
60 // attempting to explicitly use values out of the i32 range will also fail
61 // ME5_A = 0x80000000,
62 // ME5_B = 0x100000000,
63}
64
65struct MyStruct {
66 1: MyEnum2 me2_2 = MyEnum1.ME2_2
67 2: MyEnum3 me3_n2 = MyEnum3.ME3_N2
68 3: MyEnum3 me3_d1 = MyEnum3.ME3_D1
69}
70