Skip to content

Commit 2ea50b5

Browse files
committed
plutil: explictly specify Swift.type to disambiguate
The CMake based build uncovered that swift can sometimes get confused about the refernece to type in the interpolation. Workaround it by specifying the qualified name. Thanks to Lily Vulcano for the hint!
1 parent 9c39aa5 commit 2ea50b5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: Tools/plutil/main.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ extension Dictionary {
202202
if let key = $0.0 as? String {
203203
key.display(indent + 1, type: .key)
204204
} else {
205-
fatalError("plists should have strings as keys but got a \(type(of: $0.0))")
205+
fatalError("plists should have strings as keys but got a \(Swift.type(of: $0.0))")
206206
}
207207
print(" => ", terminator: "")
208208
displayPlist($0.1, indent: indent + 1, type: .value)
@@ -302,7 +302,7 @@ func displayPlist(_ plist: Any, indent: Int = 0, type: DisplayType = .primary) {
302302
case let val as NSData:
303303
val.display(indent, type: type)
304304
default:
305-
fatalError("unhandled type \(type(of: plist))")
305+
fatalError("unhandled type \(Swift.type(of: plist))")
306306
}
307307
}
308308

0 commit comments

Comments
 (0)