Jens Geyer | 6f86f9a | 2014-07-08 21:31:52 +0200 | [diff] [blame] | 1 | // Naming testcases, sepcifically for these tickets (but not limited to them) |
| 2 | // THRIFT-2508 Uncompileable C# code due to language keywords in IDL |
| 3 | // THRIFT-2557 error CS0542 member names cannot be the same as their enclosing type |
| 4 | |
| 5 | |
| 6 | struct using { |
Jens Geyer | aaa8947 | 2014-10-03 20:22:28 +0200 | [diff] [blame] | 7 | 1: double single |
| 8 | 2: double integer |
Jens Geyer | 6f86f9a | 2014-07-08 21:31:52 +0200 | [diff] [blame] | 9 | } |
| 10 | |
| 11 | struct delegate { |
Jens Geyer | aaa8947 | 2014-10-03 20:22:28 +0200 | [diff] [blame] | 12 | 1: string partial |
| 13 | 2: delegate delegate |
Jens Geyer | 6f86f9a | 2014-07-08 21:31:52 +0200 | [diff] [blame] | 14 | } |
| 15 | |
| 16 | struct get { |
Jens Geyer | aaa8947 | 2014-10-03 20:22:28 +0200 | [diff] [blame] | 17 | 1: bool sbyte |
Jens Geyer | 6f86f9a | 2014-07-08 21:31:52 +0200 | [diff] [blame] | 18 | } |
| 19 | |
| 20 | struct partial { |
Jens Geyer | aaa8947 | 2014-10-03 20:22:28 +0200 | [diff] [blame] | 21 | 1: using using |
Jens Geyer | 6f86f9a | 2014-07-08 21:31:52 +0200 | [diff] [blame] | 22 | } |
| 23 | |
Roger Meier | 16c164e | 2014-08-07 03:09:23 +0200 | [diff] [blame] | 24 | enum Maybe { |
| 25 | JUST = 1, |
| 26 | TRUE = 2, |
| 27 | FALSE = 3 |
| 28 | } |
| 29 | |
| 30 | enum Either { |
| 31 | LEFT = 1, |
| 32 | RIGHT = 2 |
| 33 | } |
| 34 | |
| 35 | struct foldr { |
| 36 | 1: string id |
| 37 | } |
| 38 | |
| 39 | struct of { |
| 40 | 1: string let |
| 41 | 2: string where |
| 42 | } |
Jens Geyer | 6f86f9a | 2014-07-08 21:31:52 +0200 | [diff] [blame] | 43 | |
alisdair sullivan | ca44a62 | 2014-08-07 06:32:37 -0700 | [diff] [blame] | 44 | struct ofOf { |
| 45 | 1: of Of |
| 46 | } |
| 47 | |
Jens Geyer | 6f86f9a | 2014-07-08 21:31:52 +0200 | [diff] [blame] | 48 | |
| 49 | struct ClassAndProp { |
| 50 | 1: bool ClassAndProp |
| 51 | 2: bool ClassAndProp_ |
| 52 | 3: bool ClassAndProp__ |
| 53 | 4: bool ClassAndProper |
| 54 | } |
| 55 | |
| 56 | struct second_chance { |
| 57 | 1: bool SECOND_CHANCE |
| 58 | 2: bool SECOND_CHANCE_ |
| 59 | 3: bool SECOND_CHANCE__ |
| 60 | 4: bool SECOND_CHANCES |
| 61 | } |
| 62 | |
| 63 | struct NOW_EAT_THIS { |
| 64 | 1: bool now_eat_this |
| 65 | 2: bool now_eat_this_ |
| 66 | 3: bool now_eat_this__ |
| 67 | 4: bool now_eat_this_and_this |
| 68 | } |
| 69 | |
| 70 | struct TheEdgeCase { |
| 71 | 1: bool theEdgeCase |
| 72 | 2: bool theEdgeCase_ |
| 73 | 3: bool theEdgeCase__ |
| 74 | 4: bool TheEdgeCase |
| 75 | 5: bool TheEdgeCase_ |
| 76 | 6: bool TheEdgeCase__ |
| 77 | } |
| 78 | |
| 79 | struct Tricky_ { |
| 80 | 1: bool tricky |
| 81 | 2: bool Tricky |
| 82 | } |
| 83 | |
| 84 | struct Nested { |
Jens Geyer | aaa8947 | 2014-10-03 20:22:28 +0200 | [diff] [blame] | 85 | 1: ClassAndProp ClassAndProp |
| 86 | 2: second_chance second_chance |
| 87 | 3: NOW_EAT_THIS NOW_EAT_THIS |
| 88 | 4: TheEdgeCase TheEdgeCase |
| 89 | 5: Tricky_ Tricky_ |
Jens Geyer | 6f86f9a | 2014-07-08 21:31:52 +0200 | [diff] [blame] | 90 | 6: Nested Nested |
| 91 | } |
| 92 | |
| 93 | exception Problem_ { |
| 94 | 1: bool problem |
| 95 | 2: bool Problem |
| 96 | } |
| 97 | |
| 98 | |
| 99 | service extern { |
Jens Geyer | aaa8947 | 2014-10-03 20:22:28 +0200 | [diff] [blame] | 100 | delegate event(1: partial get) |
| 101 | void Foo(1: Nested Foo_args) throws (1: Problem_ Foo_result) |
Jens Geyer | 6f86f9a | 2014-07-08 21:31:52 +0200 | [diff] [blame] | 102 | } |
| 103 | |
Roger Meier | 16c164e | 2014-08-07 03:09:23 +0200 | [diff] [blame] | 104 | service qualified { |
Jens Geyer | aaa8947 | 2014-10-03 20:22:28 +0200 | [diff] [blame] | 105 | Maybe maybe(1: Maybe foldr) |
| 106 | Either either(1: foldr of) |
Roger Meier | 16c164e | 2014-08-07 03:09:23 +0200 | [diff] [blame] | 107 | } |
Jens Geyer | 6f86f9a | 2014-07-08 21:31:52 +0200 | [diff] [blame] | 108 | // eof |