Skip to content

Instantly share code, notes, and snippets.

@krzyzanowskim
Last active August 29, 2015 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krzyzanowskim/27560409d09880a86e05 to your computer and use it in GitHub Desktop.
Save krzyzanowskim/27560409d09880a86e05 to your computer and use it in GitHub Desktop.
Swift crash. Initializer on protocol.
// Version 6.3 (6D532l)
protocol Proto {
init()
}
struct S1: Proto {
init() {}
}
func create() -> Proto.Type {
return S1.self
}
let crash = create()
crash() // crash!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment