After updating to Xcode 9.3 (which uses Swift 4.1), the following issue was found:
Create an empty project, add a new .swift file to it and create two new classes:
class CodableOne: Codable { let some: String } class CodableTwo: Codable { var some: String }
Build succeeds
Add a new constant to
CodableOne
of typeCodableTwo
:class CodableOne: Codable { let some: String let another: CodableTwo } class CodableTwo: Codable { var some: String }
Build succeeds
Now move class
CodableTwo
to another file (ViewController.swift, for example)Build fails.
Now there's an error, which won't go away. Codable
classes should not require initializers (as demonstrated in previous steps).
Any ideas on what could be the problem behind this and how it could be resolved will be much appreciated!
P.S. Issue is not present in Xcode 9.2. Nor cleaning the project/build path, neither re-installing Xcode 9.3 helps.