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 |
henrique | 2f34da7 | 2015-02-05 12:39:34 +1100 | [diff] [blame] | 22 | 2: bool read |
| 23 | 3: bool write |
Jens Geyer | 6f86f9a | 2014-07-08 21:31:52 +0200 | [diff] [blame] | 24 | } |
| 25 | |
Roger Meier | 16c164e | 2014-08-07 03:09:23 +0200 | [diff] [blame] | 26 | enum Maybe { |
| 27 | JUST = 1, |
| 28 | TRUE = 2, |
| 29 | FALSE = 3 |
| 30 | } |
| 31 | |
| 32 | enum Either { |
| 33 | LEFT = 1, |
| 34 | RIGHT = 2 |
| 35 | } |
| 36 | |
| 37 | struct foldr { |
| 38 | 1: string id |
| 39 | } |
| 40 | |
| 41 | struct of { |
| 42 | 1: string let |
| 43 | 2: string where |
| 44 | } |
Jens Geyer | 6f86f9a | 2014-07-08 21:31:52 +0200 | [diff] [blame] | 45 | |
alisdair sullivan | ca44a62 | 2014-08-07 06:32:37 -0700 | [diff] [blame] | 46 | struct ofOf { |
| 47 | 1: of Of |
| 48 | } |
| 49 | |
Jens Geyer | 6f86f9a | 2014-07-08 21:31:52 +0200 | [diff] [blame] | 50 | |
| 51 | struct ClassAndProp { |
| 52 | 1: bool ClassAndProp |
| 53 | 2: bool ClassAndProp_ |
| 54 | 3: bool ClassAndProp__ |
| 55 | 4: bool ClassAndProper |
| 56 | } |
| 57 | |
| 58 | struct second_chance { |
| 59 | 1: bool SECOND_CHANCE |
| 60 | 2: bool SECOND_CHANCE_ |
| 61 | 3: bool SECOND_CHANCE__ |
| 62 | 4: bool SECOND_CHANCES |
| 63 | } |
| 64 | |
| 65 | struct NOW_EAT_THIS { |
| 66 | 1: bool now_eat_this |
| 67 | 2: bool now_eat_this_ |
| 68 | 3: bool now_eat_this__ |
| 69 | 4: bool now_eat_this_and_this |
| 70 | } |
| 71 | |
| 72 | struct TheEdgeCase { |
| 73 | 1: bool theEdgeCase |
| 74 | 2: bool theEdgeCase_ |
| 75 | 3: bool theEdgeCase__ |
| 76 | 4: bool TheEdgeCase |
| 77 | 5: bool TheEdgeCase_ |
| 78 | 6: bool TheEdgeCase__ |
| 79 | } |
| 80 | |
| 81 | struct Tricky_ { |
| 82 | 1: bool tricky |
| 83 | 2: bool Tricky |
| 84 | } |
| 85 | |
| 86 | struct Nested { |
Jens Geyer | aaa8947 | 2014-10-03 20:22:28 +0200 | [diff] [blame] | 87 | 1: ClassAndProp ClassAndProp |
| 88 | 2: second_chance second_chance |
| 89 | 3: NOW_EAT_THIS NOW_EAT_THIS |
| 90 | 4: TheEdgeCase TheEdgeCase |
| 91 | 5: Tricky_ Tricky_ |
Jens Geyer | 6f86f9a | 2014-07-08 21:31:52 +0200 | [diff] [blame] | 92 | 6: Nested Nested |
| 93 | } |
| 94 | |
| 95 | exception Problem_ { |
| 96 | 1: bool problem |
| 97 | 2: bool Problem |
| 98 | } |
| 99 | |
| 100 | |
| 101 | service extern { |
Jens Geyer | aaa8947 | 2014-10-03 20:22:28 +0200 | [diff] [blame] | 102 | delegate event(1: partial get) |
| 103 | void Foo(1: Nested Foo_args) throws (1: Problem_ Foo_result) |
Jens Geyer | 6f86f9a | 2014-07-08 21:31:52 +0200 | [diff] [blame] | 104 | } |
| 105 | |
Roger Meier | 16c164e | 2014-08-07 03:09:23 +0200 | [diff] [blame] | 106 | service qualified { |
Jens Geyer | aaa8947 | 2014-10-03 20:22:28 +0200 | [diff] [blame] | 107 | Maybe maybe(1: Maybe foldr) |
| 108 | Either either(1: foldr of) |
Roger Meier | 16c164e | 2014-08-07 03:09:23 +0200 | [diff] [blame] | 109 | } |
Jens Geyer | 6f86f9a | 2014-07-08 21:31:52 +0200 | [diff] [blame] | 110 | // eof |