1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218
|
// RUN: %empty-directory(%t)
// RUN: %swift -emit-module -o %t/Exported.swiftmodule %S/Inputs/explicit-access/Exported.swift -disable-implicit-concurrency-module-import -disable-implicit-string-processing-module-import
// RUN: %swift -emit-module -o %t/Module.swiftmodule %S/Inputs/explicit-access/Module.swift -I %t -disable-implicit-concurrency-module-import -disable-implicit-string-processing-module-import
// RUN: %sourcekitd-test -req=index %s -- -I %t %s -Xfrontend -disable-implicit-concurrency-module-import -Xfrontend -disable-implicit-string-processing-module-import | %sed_clean > %t.response
// RUN: %diff -u %s.response %t.response
public enum PublicEnum {
case publicEnumCase
}
enum InternalEnum {
case internalEnumCase
}
fileprivate enum FilePrivateEnum {
case filePrivateEnumCase
}
private enum PrivateEnum {
case privateEnumCase
}
extension PublicEnum {
public func publicMethod() {}
}
public extension PublicEnum {
func methodFromPublicExtension() {}
}
extension InternalEnum {
func internalMethod() {}
}
extension FilePrivateEnum {
fileprivate func filePrivateMethod() {}
}
fileprivate extension FilePrivateEnum {
func methodFromFilePrivateExtension() {}
}
extension PrivateEnum {
private func privateMethod() {}
}
private extension PrivateEnum {
func methodFromPrivateExtension() {}
}
@propertyWrapper
public struct PublicPropertyWrapper<T> {
public var wrappedValue: T
public init(wrappedValue: T) {
self.wrappedValue = wrappedValue
}
}
@propertyWrapper
struct InternalPropertyWrapper<T> {
let wrappedValue: T
}
@propertyWrapper
fileprivate struct FilePrivatePropertyWrapper<T> {
fileprivate let wrappedValue: T
}
@propertyWrapper
private struct PrivatePropertyWrapper<T> {
private let wrappedValue: T
}
private struct ScopeReducerStruct {
public init(publicInitializer: Int) {}
init(internalInitializer: Int) {}
fileprivate init(filePrivateInitializer: Int) {}
private init(privateInitializer: Int) {}
public let publicProperty: Int = 0
let internalProperty: Int = 0
fileprivate let filePrivateProperty: Int = 0
private let privateProperty: Int = 0
public private(set) var publicPropertyWithPrivateSetter: Int = 0
@PublicPropertyWrapper public var publicPropertyWrappedProperty: Int = 0
@PublicPropertyWrapper var internalPropertyWrappedProperty: Int = 0
@PublicPropertyWrapper fileprivate var filePrivatePropertyWrappedProperty: Int = 0
@PublicPropertyWrapper private var privatePropertyWrappedProperty: Int = 0
public subscript(publicSubscript: Int) -> Int { return 0 }
subscript(internalSubscript: Int) -> Int { return 0 }
fileprivate subscript(filePrivateSubscript: Int) -> Int { return 0 }
private subscript(privateSubscript: Int) -> Int { return 0 }
public func publicMethod() {}
func internalMethod() {}
fileprivate func filePrivateMethod() {}
private func privateMethod() {}
}
public struct ScopeKeeperStruct {
public init(publicInitializer: Int) {}
init(internalInitializer: Int) {}
fileprivate init(filePrivateInitializer: Int) {}
private init(privateInitializer: Int) {}
public let publicProperty: Int = 0
let internalProperty: Int = 0
fileprivate let filePrivateProperty: Int = 0
private let privateProperty: Int = 0
public private(set) var publicPropertyWithPrivateSetter: Int = 0
@PublicPropertyWrapper public var publicPropertyWrappedProperty: Int = 0
@PublicPropertyWrapper var internalPropertyWrappedProperty: Int = 0
@PublicPropertyWrapper fileprivate var filePrivatePropertyWrappedProperty: Int = 0
@PublicPropertyWrapper private var privatePropertyWrappedProperty: Int = 0
public subscript(publicSubscript: Int) -> Int { return 0 }
subscript(internalSubscript: Int) -> Int { return 0 }
fileprivate subscript(filePrivateSubscript: Int) -> Int { return 0 }
private subscript(privateSubscript: Int) -> Int { return 0 }
public func publicMethod() {}
func internalMethod() {}
fileprivate func filePrivateMethod() {}
private func privateMethod() {}
}
struct PartialScopeReducerStruct {
public init(publicInitializer: Int) {}
init(internalInitializer: Int) {}
fileprivate init(filePrivateInitializer: Int) {}
private init(privateInitializer: Int) {}
public let publicProperty: Int = 0
let internalProperty: Int = 0
fileprivate let filePrivateProperty: Int = 0
private let privateProperty: Int = 0
public private(set) var publicPropertyWithPrivateSetter: Int = 0
@PublicPropertyWrapper public var publicPropertyWrappedProperty: Int = 0
@PublicPropertyWrapper var internalPropertyWrappedProperty: Int = 0
@PublicPropertyWrapper fileprivate var filePrivatePropertyWrappedProperty: Int = 0
@PublicPropertyWrapper private var privatePropertyWrappedProperty: Int = 0
public subscript(publicSubscript: Int) -> Int { return 0 }
subscript(internalSubscript: Int) -> Int { return 0 }
fileprivate subscript(filePrivateSubscript: Int) -> Int { return 0 }
private subscript(privateSubscript: Int) -> Int { return 0 }
public func publicMethod() {}
func internalMethod() {}
fileprivate func filePrivateMethod() {}
private func privateMethod() {}
}
private extension PrivateEnum {
private func privateMethodFromPrivateExtension() {}
}
public protocol PublicProtocol {
var member: Int { get set }
func method()
}
protocol InternalProtocol {
var member: Int { get set }
func method()
}
fileprivate protocol FilePrivateProtocol {
var member: Int { get set }
func method()
}
private protocol PrivateProtocol {
var member: Int { get set }
func method()
}
fileprivate struct FilePrivateImplementationOfPublicProtocol: PublicProtocol {
fileprivate var member: Int = 0
fileprivate func method() {}
}
open class OpenClass {
open var openProperty: Int { return 0 }
public var publicProperty: Int { return 0 }
var internalProperty: Int { return 0 }
open func openMethod() {}
public func publicMethod() {}
func internalMethod() {}
}
import Module
struct InternalStruct {
let propertyReferencingPublicClassFromModule: Module.ModuleClass
let propertyReferencingPublicClassFromExportedModule: Exported.ExportedClass
}
public typealias Alias = Int
public var globalVariable: Int = 0
protocol ProtocolWithAssociatedType {
associatedtype T
}
struct ProtocolWithAssociatedTypeImpl: ProtocolWithAssociatedType {
typealias T = Int
func testLocalContent() {
let localVariableShouldntBeIndexed = 0
}
}
|