|
| 1 | +@AAA import FooModule1 |
| 2 | +@BBB(1, 2, 3) import FooModule2.SubModule1 |
| 3 | +import typealias FooModule3.ImportedTypeAlias |
| 4 | +import struct FooModule3.ImportedStruct |
| 5 | +import class FooModule3.ImportedClass |
| 6 | +import enum FooModule3.ImportedEnum |
| 7 | +import protocol FooModule3.ImportedProtocol |
| 8 | +import let FooModule3.importedConstant |
| 9 | +import var FooModule3.importedVariable |
| 10 | +import func FooModule3.importedFunction |
| 11 | + |
| 12 | +@AAA let globalConstant1 = 1, |
| 13 | + globalConstant2: Int = 2 |
| 14 | +@AAA var globalVariable1 = 1, |
| 15 | + globalVariable2: Int = 2 |
| 16 | + |
| 17 | +@AAA class FooClass<A, B, C>: AAA { |
| 18 | + @AAA private unowned(safe) lazy class final var classVariable1: AAA = AAA() |
| 19 | + @AAA public class final { |
| 20 | + } |
| 21 | + |
| 22 | + @AAA var compuatedProperty: Int { |
| 23 | + get { |
| 24 | + return 1 |
| 25 | + } |
| 26 | + |
| 27 | + set { |
| 28 | + let a = 1 |
| 29 | + var b = 2 |
| 30 | + } |
| 31 | + } |
| 32 | + |
| 33 | + @AAA var observedProperty Int { |
| 34 | + willSet(a) { |
| 35 | + let a = 1 |
| 36 | + var b = 2 |
| 37 | + } |
| 38 | + |
| 39 | + didSet(a) { |
| 40 | + } |
| 41 | + } |
| 42 | + |
| 43 | + @AAA internal typealias TypeAlias<A: AA, B: BB, C: CC> = AAA |
| 44 | + |
| 45 | + @AAA class final func function1<A: AA, B: BB, C: CC>(aaa bbb: Int, _ ccc: Int, ddd: Int = 1, eee: inout Int = 2) throws -> AAA { |
| 46 | + let a = 1 |
| 47 | + var b = 2 |
| 48 | + |
| 49 | + return AAA() |
| 50 | + } |
| 51 | + @AAA class final func function2() rethrows -> AAA { |
| 52 | + return AAA() |
| 53 | + } |
| 54 | + @AAA class final func function3(a: Int...) rethrows -> AAA { |
| 55 | + return AAA() |
| 56 | + } |
| 57 | + |
| 58 | + // Argument labels of operators are always "_" |
| 59 | + @AAA class final func + <A: AA, B: BB, C: CC>(lhs: FooClass1<A, B, C>, rhs: Int) rethrows -> AAA { |
| 60 | + return AAA() |
| 61 | + } |
| 62 | + |
| 63 | + // Default argument labels of subscript are "_". |
| 64 | + subscript<A: AA, B: BB, C: CC>(aaa: Int, bbb ccc: Int) -> AAA { |
| 65 | + get { |
| 66 | + return AAA() |
| 67 | + } |
| 68 | + set { |
| 69 | + } |
| 70 | + } |
| 71 | + |
| 72 | + init?(a: Int) { |
| 73 | + } |
| 74 | + |
| 75 | + init!(b: Int) { |
| 76 | + } |
| 77 | + |
| 78 | + deinit { |
| 79 | + } |
| 80 | +} |
| 81 | + |
| 82 | +@AAA enum FooEnum1<A, B, C>: FooProtocol { |
| 83 | + @AAA case case1(aaa: Int, bbb ccc: Int), case2 |
| 84 | + @AAA indirect case case3(eee: FooEnum) |
| 85 | +} |
| 86 | + |
| 87 | +enum FooEnum2: Int { |
| 88 | + case case1 = 1, |
| 89 | + case2 = 2 |
| 90 | +} |
| 91 | + |
| 92 | +struct FooStruct: AAA { |
| 93 | +} |
| 94 | + |
| 95 | +protocol FooProtocol: AAA { |
| 96 | + var protocolProperty: Int { get set} |
| 97 | + func protocolMethod(a: Int, b: Int) -> Int |
| 98 | + init(a: Int, b: Int, c d: Int) |
| 99 | + subscript<A: AA, B: BB, C: CC>(aaa: Int, bbb ccc: Int) -> AAA |
| 100 | + associatedtype AssociatedType: AAA |
| 101 | +} |
| 102 | + |
| 103 | +extension FooClass: BBB where A = Int { |
| 104 | + class NestedClass1 { |
| 105 | + class NestedClass2 { |
| 106 | + class NestedClass3 { |
| 107 | + } |
| 108 | + } |
| 109 | + } |
| 110 | +} |
| 111 | + |
| 112 | +infix operator +++++: precedenceGroup |
| 113 | +prefix operator -----: precedenceGroup |
| 114 | +postfix operator *****: precedenceGroup |
| 115 | + |
| 116 | +precedencegroup precedenceGroup { |
| 117 | + higherThan: a |
| 118 | + lowerThan: a |
| 119 | + associativity: left |
| 120 | + assignment: true |
| 121 | +} |
0 commit comments