Villarrealized
Villarrealized

Reputation: 877

XCode 7.2 crashes when protocol extension implements function incorrectly

Not sure if anyone else has run into this, but the following code will cause XCode to immediately error out with 'SourceKitService quit unexpectedly' and sometimes causes XCode to crash completely.

I ran into this scenario in my project when I had changed my default implementation of the protocol function in the extension, but forgot to change the declaration in the protocol to match.

protocol Crash{
        func crash(age: Int) ->String
    }

extension Crash{
    func crash(name: String) -> String{
        return "Test"
    }
}

class TestCrash: Crash{

}

Upvotes: 0

Views: 109

Answers (1)

Eric Aya
Eric Aya

Reputation: 70094

This bug seems to have been fixed in Xcode 7.3 beta.

Xcode 7.3b just states the error in a message and doesn't crash anymore.

enter image description here

Upvotes: 1

Related Questions