protocol X {} class A: X { class func foo(x: A) { print(x) } } class B: A { override class func foo(x: X) { print(x) } }