I couldn’t get either form of failable inits to compile in build .1917, are they supposed to be implemented?
This code compiles in XCode:
var str = "Hello, playground"
class MyError: ErrorType
{}
class MyClass
{
// compile error on the ?
init?()
{
return nil
}
// compile error on the throws
init(secondInit: String) throws
{
throw MyError()
}
}
let mc = MyClass()
Attached project
cool. Do you think there will be a timely fix? I hate bugging on bug reports, but I need to work out whether to do a ton of refactoring to remove throws from about 15 odd constructors and change them to static factory constructors, or wait for a new Silver build
I’ll talk to the team to see if we can give it prio. Won’t make it into tomorrow’s build though, sorry. Next week should be feasible (but no promises).
Just ran into this. I understand you guys have to establish/follow priorities, but it might be worth putting in the time to create a more comprehensive “Limitations” document to describe the subset of Swift you support. Although I think you’ve done a great job in terms of scope, I think the current document gives an unrealistic impression.