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 {
160
160
// This allows the code to be portable, and expose a portable API, but it is not
161
161
// very efficient.
162
162
163
- private let nsBooleanType = NSNumber ( value: false ) . dynamicType
163
+ private let nsBooleanType = type ( of : NSNumber ( value: false ) )
164
164
extension JSON {
165
165
private static func convertToJSON( _ object: Any ) -> JSON {
166
166
switch object {
@@ -173,7 +173,7 @@ extension JSON {
173
173
// Check if this is a boolean.
174
174
//
175
175
// FIXME: This is all rather unfortunate and expensive.
176
- if value. dynamicType === nsBooleanType {
176
+ if type ( of : value) === nsBooleanType {
177
177
return . bool( value != 0 )
178
178
}
179
179
@@ -214,7 +214,7 @@ extension JSON {
214
214
return . dictionary( result)
215
215
216
216
default :
217
- fatalError ( " unexpected object: \( object) \( object. dynamicType ) " )
217
+ fatalError ( " unexpected object: \( object) \( type ( of : object) ) " )
218
218
}
219
219
}
220
220
Original file line number Diff line number Diff line change @@ -77,7 +77,7 @@ public class Module: ModuleProtocol {
77
77
/// The base prefix for the test module, used to associate with the target it tests.
78
78
public var basename : String {
79
79
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. " )
81
81
}
82
82
precondition ( name. hasSuffix ( Module . testModuleNameSuffix) )
83
83
return name [ name. startIndex..< name. index ( name. endIndex, offsetBy: - Module. testModuleNameSuffix. characters. count) ]
@@ -139,6 +139,6 @@ public class ClangModule: Module {
139
139
140
140
extension Module : CustomStringConvertible {
141
141
public var description : String {
142
- return " \( self . dynamicType ) ( \( name) ) "
142
+ return " \( type ( of : self ) ) ( \( name) ) "
143
143
}
144
144
}
Original file line number Diff line number Diff line change @@ -256,6 +256,6 @@ public class CheckoutManager {
256
256
257
257
extension CheckoutManager . RepositoryHandle : CustomStringConvertible {
258
258
public var description : String {
259
- return " < \( self . dynamicType ) subpath: \( subpath. asString) > "
259
+ return " < \( type ( of : self ) ) subpath: \( subpath. asString) > "
260
260
}
261
261
}
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ func run() throws {
49
49
// otherwise use the name property (which only gives subclass name).
50
50
let name : String
51
51
if let firstTest = testCaseSuite. tests. first {
52
- name = String ( reflecting: firstTest. dynamicType )
52
+ name = String ( reflecting: type ( of : firstTest) )
53
53
} else {
54
54
name = testCaseSuite. name ?? " nil "
55
55
}
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ class ReaddirTests: XCTestCase {
38
38
39
39
do {
40
40
var s = dirent ( )
41
- let n = sizeof ( s. d_name. dynamicType )
41
+ let n = sizeof ( type ( of : s. d_name) )
42
42
withUnsafeMutablePointer ( to: & s. d_name) { ptr in
43
43
let ptr = unsafeBitCast ( ptr, to: UnsafeMutablePointer< UInt8> . self )
44
44
for i in 0 ..< n {
You can’t perform that action at this time.
0 commit comments