File tree Expand file tree Collapse file tree 5 files changed +8
-8
lines changed Expand file tree Collapse file tree 5 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -160,7 +160,7 @@ enum JSONDecodingError: Swift.Error {
160160// This allows the code to be portable, and expose a portable API, but it is not
161161// very efficient.
162162
163- private let nsBooleanType = NSNumber ( value: false ) . dynamicType
163+ private let nsBooleanType = type ( of : NSNumber ( value: false ) )
164164extension JSON {
165165 private static func convertToJSON( _ object: Any ) -> JSON {
166166 switch object {
@@ -173,7 +173,7 @@ extension JSON {
173173 // Check if this is a boolean.
174174 //
175175 // FIXME: This is all rather unfortunate and expensive.
176- if value. dynamicType === nsBooleanType {
176+ if type ( of : value) === nsBooleanType {
177177 return . bool( value != 0 )
178178 }
179179
@@ -214,7 +214,7 @@ extension JSON {
214214 return . dictionary( result)
215215
216216 default :
217- fatalError ( " unexpected object: \( object) \( object. dynamicType ) " )
217+ fatalError ( " unexpected object: \( object) \( type ( of : object) ) " )
218218 }
219219 }
220220
Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ public class Module: ModuleProtocol {
7777 /// The base prefix for the test module, used to associate with the target it tests.
7878 public var basename : String {
7979 guard isTest else {
80- fatalError ( " \( self . dynamicType ) should be a test module to access basename. " )
80+ fatalError ( " \( type ( of : self ) ) should be a test module to access basename. " )
8181 }
8282 precondition ( name. hasSuffix ( Module . testModuleNameSuffix) )
8383 return name [ name. startIndex..< name. index ( name. endIndex, offsetBy: - Module. testModuleNameSuffix. characters. count) ]
@@ -139,6 +139,6 @@ public class ClangModule: Module {
139139
140140extension Module : CustomStringConvertible {
141141 public var description : String {
142- return " \( self . dynamicType ) ( \( name) ) "
142+ return " \( type ( of : self ) ) ( \( name) ) "
143143 }
144144}
Original file line number Diff line number Diff line change @@ -256,6 +256,6 @@ public class CheckoutManager {
256256
257257extension CheckoutManager . RepositoryHandle : CustomStringConvertible {
258258 public var description : String {
259- return " < \( self . dynamicType ) subpath: \( subpath. asString) > "
259+ return " < \( type ( of : self ) ) subpath: \( subpath. asString) > "
260260 }
261261}
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ func run() throws {
4949 // otherwise use the name property (which only gives subclass name).
5050 let name : String
5151 if let firstTest = testCaseSuite. tests. first {
52- name = String ( reflecting: firstTest. dynamicType )
52+ name = String ( reflecting: type ( of : firstTest) )
5353 } else {
5454 name = testCaseSuite. name ?? " nil "
5555 }
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ class ReaddirTests: XCTestCase {
3838
3939 do {
4040 var s = dirent ( )
41- let n = sizeof ( s. d_name. dynamicType )
41+ let n = sizeof ( type ( of : s. d_name) )
4242 withUnsafeMutablePointer ( to: & s. d_name) { ptr in
4343 let ptr = unsafeBitCast ( ptr, to: UnsafeMutablePointer< UInt8> . self )
4444 for i in 0 ..< n {
You can’t perform that action at this time.
0 commit comments