title: Calling a protocol method results in a crash
body: <p>I use protocol to call a func and then I get a crash . I know how to fix that ,but I want to exact know, why it can't work ,and why that can work . I think the problem may be is method dispath problem.</p>
  
  <pre><code>protocol Testable where Self : UIView{
      func update()
  }
  
  class JKD : UIView,Testable{
      func update() {
          print("JKD")
      }
  }
  
  func test(a : Testable){
      a.update()
  }
  
  let j2 : JKD = JKD.init(frame: CGRect.zero)
  test(a: j2) // it will crash 
  </code></pre>
  
  <p>And this crash have mush of way to fix , like this :</p>
  
  <pre><code>@objc protocol Testable where Self : UIView{
      func update()
  }
  </code></pre>
  
  <p>or this : </p>
  
  <pre><code>protocol Testable{
      func update()
  }
  </code></pre>
  
  <p>and if the func use Generic,it also can fix the crash</p>
  
  <pre><code>func test&lt;T : Testable&gt;(a : T) {
      a.update()
  }
  </code></pre>
  
  <p>or if the class in extension inherit the protocol,it can fix the crash too.</p>
  
  <pre><code>class JKD : UIView{}
  extension JKD : Testable{
      func update() {
          print("JKD")
      }
  }
  </code></pre>
  
  <p>so , in this case I want to know, why just the first way will crash .</p>