Commits
Michael Gottesman committed 61d7421fbab
[sil-gen] Emit class methods for in protocol methods for classes so that
inherited conformances can result in virtual calls to overriding
subclass methods.
Previously given the following swift code:
protocol P {
func x()
}
class B : P {
func x() { ... }
}
class B2 : B {
func x() { ... }
}
func doX<T : P>(t : T) {
t.x()
}
var b2 = B2()
doX(b2)
We would have b2 reference the protocol method for B.x. But since the
protocol method B.x would have a direct function reference to B.x, we
would not get the correct behavior that doX(b2) should invoke B2.x. This
is fixed by changing SILGen to emit class_method calls in protocol
methods for classes.
Swift SVN r16645