I'm currently in Swift 3.1 and the following code does not compile.
protocol HeaderDisplayable { func setTitle(_ string: String) } class MyView: UILabel, HeaderDisplayable { func setTitle(_ string: String) { self.text = string } } func foo<T: UILabel>(view:T) where T: HeaderDisplayable{ view.setTitle("HEY") } foo(MyView()) The error message is saying
Generic parameter 'T' could not be inferred