Hi, Community.
I have upgrade Xcode to 10.2 and found my project stuck in building a Swift file forever.
This issue can be easily reproduced with following file:
import Foundation
// Types
struct Foo: Codable {}
struct Bar: Codable {}
// MARK:
struct ItemEnvelope<Element> {
let items: [Element]
}
extension ItemEnvelope: Codable where Element: Codable {
enum CodingKeys: String, CodingKey {
case items = "list"
}
}
class CodableGeneric: Runnable {
static func run() {
let fooEnvelope = ItemEnvelope(items: [Foo()])
let barEnvelope = ItemEnvelope(items: [Bar()])
let encoder = JSONEncoder()
let encodedHello = try! encoder.encode(fooEnvelope)
let encodedHi = try! encoder.encode(barEnvelope)
print(fooEnvelope, barEnvelope)
}
}
The build was success if this file is removed or commented. During the building, Xcode doesn't provide any error information, it just stuck.
Any help is welcomed.