Avatar
@swift-5.0.3 protocol P { // mutating func foo() } extension P { mutating func foo() { print("P") } } struct S: P { func foo() { print("S") } mutating func foo() { print("S2") } } let s: S = S() s.foo() // "S" var s2: S = S() s2.foo() // "S" var p: P = s p.foo() // "S" (edited)