|
| 1 | +// RUN: %target-swift-ide-test -print-indexed-symbols -source-filename %s | %FileCheck %s |
| 2 | + |
| 3 | +struct CustomInteger: ExpressibleByIntegerLiteral { |
| 4 | + init(integerLiteral: Int) {} |
| 5 | +} |
| 6 | +struct CustomFloat: ExpressibleByFloatLiteral { |
| 7 | + init(floatLiteral: Double) {} |
| 8 | +} |
| 9 | +struct CustomBool: ExpressibleByBooleanLiteral { |
| 10 | + init(booleanLiteral: Bool) {} |
| 11 | +} |
| 12 | +struct CustomNil: ExpressibleByNilLiteral { |
| 13 | + init(nilLiteral: ()) {} |
| 14 | +} |
| 15 | +struct CustomString: ExpressibleByStringLiteral { |
| 16 | + init(stringLiteral: StaticString) {} |
| 17 | +} |
| 18 | +struct CustomScalar: ExpressibleByUnicodeScalarLiteral { |
| 19 | + init(unicodeScalarLiteral: Unicode.Scalar) {} |
| 20 | +} |
| 21 | +struct CustomCharacter: ExpressibleByExtendedGraphemeClusterLiteral { |
| 22 | + init(extendedGraphemeClusterLiteral: Character) {} |
| 23 | +} |
| 24 | +struct CustomArray: ExpressibleByArrayLiteral { |
| 25 | + init(arrayLiteral: Int...) {} |
| 26 | +} |
| 27 | +struct CustomDictionary: ExpressibleByDictionaryLiteral { |
| 28 | + init(dictionaryLiteral: (Int, Int)...) {} |
| 29 | +} |
| 30 | +struct CustomInterpolation: ExpressibleByStringInterpolation { |
| 31 | + init(stringInterpolation: StringInterpolation) {} |
| 32 | + init(stringLiteral: String) {} |
| 33 | +} |
| 34 | + |
| 35 | +func customInteger() { |
| 36 | + // CHECK: [[@LINE+2]]:26 | constructor/Swift | init(integerLiteral:) | s:14swift_ide_test13CustomIntegerV14integerLiteralACSi_tcfc | Ref,Call,Impl,RelCall,RelCont | |
| 37 | + // CHECK-NEXT: RelCall,RelCont | function/Swift | customInteger() | s:14swift_ide_test13customIntegeryyF |
| 38 | + let _: CustomInteger = 100 |
| 39 | + // CHECK: [[@LINE+2]]:7 | constructor/Swift | init(integerLiteral:) | s:14swift_ide_test13CustomIntegerV14integerLiteralACSi_tcfc | Ref,Call,Impl,RelCall,RelCont | |
| 40 | + // CHECK-NEXT: RelCall,RelCont | function/Swift | customInteger() | s:14swift_ide_test13customIntegeryyF |
| 41 | + _ = 100 as CustomInteger |
| 42 | + // CHECK: [[@LINE+2]]:21 | constructor/Swift | init(integerLiteral:) | s:14swift_ide_test13CustomIntegerV14integerLiteralACSi_tcfc | Ref,Call,Impl,RelCall,RelCont | |
| 43 | + // CHECK-NEXT: RelCall,RelCont | function/Swift | customInteger() | s:14swift_ide_test13customIntegeryyF |
| 44 | + _ = CustomInteger(100) |
| 45 | +} |
| 46 | +func customFloat() { |
| 47 | + // CHECK: [[@LINE+2]]:24 | constructor/Swift | init(floatLiteral:) | s:14swift_ide_test11CustomFloatV12floatLiteralACSd_tcfc | Ref,Call,Impl,RelCall,RelCont | |
| 48 | + // CHECK-NEXT: RelCall,RelCont | function/Swift | customFloat() | s:14swift_ide_test11customFloatyyF |
| 49 | + let _: CustomFloat = -1.23 |
| 50 | + // CHECK: [[@LINE+2]]:7 | constructor/Swift | init(floatLiteral:) | s:14swift_ide_test11CustomFloatV12floatLiteralACSd_tcfc | Ref,Call,Impl,RelCall,RelCont | |
| 51 | + // CHECK-NEXT: RelCall,RelCont | function/Swift | customFloat() | s:14swift_ide_test11customFloatyyF |
| 52 | + _ = -1.23 as CustomFloat |
| 53 | + // CHECK: [[@LINE+2]]:19 | constructor/Swift | init(floatLiteral:) | s:14swift_ide_test11CustomFloatV12floatLiteralACSd_tcfc | Ref,Call,Impl,RelCall,RelCont | |
| 54 | + // CHECK-NEXT: RelCall,RelCont | function/Swift | customFloat() | s:14swift_ide_test11customFloatyyF |
| 55 | + _ = CustomFloat(-1.23) |
| 56 | +} |
| 57 | +func customBool() { |
| 58 | + // CHECK: [[@LINE+2]]:23 | constructor/Swift | init(booleanLiteral:) | s:14swift_ide_test10CustomBoolV14booleanLiteralACSb_tcfc | Ref,Call,Impl,RelCall,RelCont | |
| 59 | + // CHECK-NEXT: RelCall,RelCont | function/Swift | customBool() | s:14swift_ide_test10customBoolyyF |
| 60 | + let _: CustomBool = true |
| 61 | + // CHECK: [[@LINE+2]]:7 | constructor/Swift | init(booleanLiteral:) | s:14swift_ide_test10CustomBoolV14booleanLiteralACSb_tcfc | Ref,Call,Impl,RelCall,RelCont | |
| 62 | + // CHECK-NEXT: RelCall,RelCont | function/Swift | customBool() | s:14swift_ide_test10customBoolyyF |
| 63 | + _ = false as CustomBool |
| 64 | + // CHECK: [[@LINE+2]]:18 | constructor/Swift | init(booleanLiteral:) | s:14swift_ide_test10CustomBoolV14booleanLiteralACSb_tcfc | Ref,Call,Impl,RelCall,RelCont | |
| 65 | + // CHECK-NEXT: RelCall,RelCont | function/Swift | customBool() | s:14swift_ide_test10customBoolyyF |
| 66 | + _ = CustomBool(true) |
| 67 | +} |
| 68 | +func customNil() { |
| 69 | + // CHECK: [[@LINE+2]]:22 | constructor/Swift | init(nilLiteral:) | s:14swift_ide_test9CustomNilV10nilLiteralACyt_tcfc | Ref,Call,Impl,RelCall,RelCont | |
| 70 | + // CHECK-NEXT: RelCall,RelCont | function/Swift | customNil() | s:14swift_ide_test9customNilyyF |
| 71 | + let _: CustomNil = nil |
| 72 | + // CHECK: [[@LINE+2]]:7 | constructor/Swift | init(nilLiteral:) | s:14swift_ide_test9CustomNilV10nilLiteralACyt_tcfc | Ref,Call,Impl,RelCall,RelCont | |
| 73 | + // CHECK-NEXT: RelCall,RelCont | function/Swift | customNil() | s:14swift_ide_test9customNilyyF |
| 74 | + _ = nil as CustomNil |
| 75 | +} |
| 76 | +func customString() { |
| 77 | + // CHECK: [[@LINE+2]]:25 | constructor/Swift | init(stringLiteral:) | s:14swift_ide_test12CustomStringV13stringLiteralACs06StaticE0V_tcfc | Ref,Call,Impl,RelCall,RelCont | |
| 78 | + // CHECK-NEXT: RelCall,RelCont | function/Swift | customString() | s:14swift_ide_test12customStringyyF |
| 79 | + let _: CustomString = "abc" |
| 80 | + // CHECK: [[@LINE+2]]:7 | constructor/Swift | init(stringLiteral:) | s:14swift_ide_test12CustomStringV13stringLiteralACs06StaticE0V_tcfc | Ref,Call,Impl,RelCall,RelCont | |
| 81 | + // CHECK-NEXT: RelCall,RelCont | function/Swift | customString() | s:14swift_ide_test12customStringyyF |
| 82 | + _ = "abc" as CustomString |
| 83 | + // CHECK: [[@LINE+2]]:20 | constructor/Swift | init(stringLiteral:) | s:14swift_ide_test12CustomStringV13stringLiteralACs06StaticE0V_tcfc | Ref,Call,Impl,RelCall,RelCont | |
| 84 | + // CHECK-NEXT: RelCall,RelCont | function/Swift | customString() | s:14swift_ide_test12customStringyyF |
| 85 | + _ = CustomString("abc") |
| 86 | +} |
| 87 | +func customScalar() { |
| 88 | + // CHECK: [[@LINE+2]]:25 | constructor/Swift | init(unicodeScalarLiteral:) | s:14swift_ide_test12CustomScalarV07unicodeE7LiteralACs7UnicodeO0E0V_tcfc | Ref,Call,Impl,RelCall,RelCont | |
| 89 | + // CHECK-NEXT: RelCall,RelCont | function/Swift | customScalar() | s:14swift_ide_test12customScalaryyF |
| 90 | + let _: CustomScalar = "a" |
| 91 | + // CHECK: [[@LINE+2]]:7 | constructor/Swift | init(unicodeScalarLiteral:) | s:14swift_ide_test12CustomScalarV07unicodeE7LiteralACs7UnicodeO0E0V_tcfc | Ref,Call,Impl,RelCall,RelCont | |
| 92 | + // CHECK-NEXT: RelCall,RelCont | function/Swift | customScalar() | s:14swift_ide_test12customScalaryyF |
| 93 | + _ = "a" as CustomScalar |
| 94 | + // CHECK: [[@LINE+2]]:20 | constructor/Swift | init(unicodeScalarLiteral:) | s:14swift_ide_test12CustomScalarV07unicodeE7LiteralACs7UnicodeO0E0V_tcfc | Ref,Call,Impl,RelCall,RelCont | |
| 95 | + // CHECK-NEXT: RelCall,RelCont | function/Swift | customScalar() | s:14swift_ide_test12customScalaryyF |
| 96 | + _ = CustomScalar("a") |
| 97 | +} |
| 98 | +func customCharacter() { |
| 99 | + // CHECK: [[@LINE+2]]:28 | constructor/Swift | init(extendedGraphemeClusterLiteral:) | s:14swift_ide_test15CustomCharacterV30extendedGraphemeClusterLiteralACSJ_tcfc | Ref,Call,Impl,RelCall,RelCont | |
| 100 | + // CHECK-NEXT: RelCall,RelCont | function/Swift | customCharacter() | s:14swift_ide_test15customCharacteryyF |
| 101 | + let _: CustomCharacter = "a" |
| 102 | + // CHECK: [[@LINE+2]]:7 | constructor/Swift | init(extendedGraphemeClusterLiteral:) | s:14swift_ide_test15CustomCharacterV30extendedGraphemeClusterLiteralACSJ_tcfc | Ref,Call,Impl,RelCall,RelCont | |
| 103 | + // CHECK-NEXT: RelCall,RelCont | function/Swift | customCharacter() | s:14swift_ide_test15customCharacteryyF |
| 104 | + _ = "a" as CustomCharacter |
| 105 | + // CHECK: [[@LINE+2]]:23 | constructor/Swift | init(extendedGraphemeClusterLiteral:) | s:14swift_ide_test15CustomCharacterV30extendedGraphemeClusterLiteralACSJ_tcfc | Ref,Call,Impl,RelCall,RelCont | |
| 106 | + // CHECK-NEXT: RelCall,RelCont | function/Swift | customCharacter() | s:14swift_ide_test15customCharacteryyF |
| 107 | + _ = CustomCharacter("a") |
| 108 | +} |
| 109 | +func customArray() { |
| 110 | + // CHECK: [[@LINE+2]]:24 | constructor/Swift | init(arrayLiteral:) | s:14swift_ide_test11CustomArrayV12arrayLiteralACSid_tcfc | Ref,Call,Impl,RelCall,RelCont | |
| 111 | + // CHECK-NEXT: RelCall,RelCont | function/Swift | customArray() | s:14swift_ide_test11customArrayyyF |
| 112 | + let _: CustomArray = [1, 2, 3] |
| 113 | + // CHECK: [[@LINE+2]]:7 | constructor/Swift | init(arrayLiteral:) | s:14swift_ide_test11CustomArrayV12arrayLiteralACSid_tcfc | Ref,Call,Impl,RelCall,RelCont | |
| 114 | + // CHECK-NEXT: RelCall,RelCont | function/Swift | customArray() | s:14swift_ide_test11customArrayyyF |
| 115 | + _ = [1, 2, 3] as CustomArray |
| 116 | +} |
| 117 | +func customDictionary() { |
| 118 | + // CHECK: [[@LINE+2]]:29 | constructor/Swift | init(dictionaryLiteral:) | s:14swift_ide_test16CustomDictionaryV17dictionaryLiteralACSi_Sitd_tcfc | Ref,Call,Impl,RelCall,RelCont | |
| 119 | + // CHECK-NEXT: RelCall,RelCont | function/Swift | customDictionary() | s:14swift_ide_test16customDictionaryyyF |
| 120 | + let _: CustomDictionary = [1: 1, 2: 2, 3: 3] |
| 121 | + // CHECK: [[@LINE+2]]:7 | constructor/Swift | init(dictionaryLiteral:) | s:14swift_ide_test16CustomDictionaryV17dictionaryLiteralACSi_Sitd_tcfc | Ref,Call,Impl,RelCall,RelCont | |
| 122 | + // CHECK-NEXT: RelCall,RelCont | function/Swift | customDictionary() | s:14swift_ide_test16customDictionaryyyF |
| 123 | + _ = [1: 1, 2: 2, 3: 3] as CustomDictionary |
| 124 | +} |
| 125 | +func customInterpolation() { |
| 126 | + // CHECK: [[@LINE+2]]:32 | constructor/Swift | init(stringInterpolation:) | s:14swift_ide_test19CustomInterpolationV06stringE0ACs013DefaultStringE0V_tcfc | Ref,Call,Impl,RelCall,RelCont | |
| 127 | + // CHECK-NEXT: RelCall,RelCont | function/Swift | customInterpolation() | s:14swift_ide_test19customInterpolationyyF |
| 128 | + let _: CustomInterpolation = "a\(0)b" |
| 129 | + // CHECK: [[@LINE+2]]:7 | constructor/Swift | init(stringInterpolation:) | s:14swift_ide_test19CustomInterpolationV06stringE0ACs013DefaultStringE0V_tcfc | Ref,Call,Impl,RelCall,RelCont | |
| 130 | + // CHECK-NEXT: RelCall,RelCont | function/Swift | customInterpolation() | s:14swift_ide_test19customInterpolationyyF |
| 131 | + _ = "a\(0)b" as CustomInterpolation |
| 132 | + // CHECK: [[@LINE+2]]:27 | constructor/Swift | init(stringInterpolation:) | s:14swift_ide_test19CustomInterpolationV06stringE0ACs013DefaultStringE0V_tcfc | Ref,Call,Impl,RelCall,RelCont | |
| 133 | + // CHECK-NEXT: RelCall,RelCont | function/Swift | customInterpolation() | s:14swift_ide_test19customInterpolationyyF |
| 134 | + _ = CustomInterpolation("a\(0)b") |
| 135 | +} |
0 commit comments