   }
 }
 
-extension ClassE: ProtocolD { }
+extension ClassE: ProtocolA { }
 
 public class ClassF {
   func foo() -> Int {

}

protocol ProtocolB {
  func bar() -> Int
}

protocol ProtocolC {
  func foo() -> Int
}

protocol ProtocolD {
  func foo() -> Int
}

protocol ProtocolE {
  func foo() -> Int
}

protocol ProtocolF {
  func foo() -> Int
}

protocol ProtocolG {
  func bar() -> Int
}

protocol ProtocolH {
  func bar() -> Int
}


  return x.foo()
}

func shouldOptimize2(_ x: ClassD & ProtocolA) -> Int {
  return x.foo()
}

func shouldOptimize3(_ x: ProtocolA & ProtocolB) -> Int {
  return x.foo() + x.bar()
}

func shouldOptimize4(_ x: ProtocolA & ProtocolB) -> Int {
  return x.foo() + x.bar()
}

func shouldOptimize5(_ x: ClassH.type & ProtocolA) -> Int {
  return x.foo()
}

