Skip to content

Instantly share code, notes, and snippets.

@regnerjr
Created November 14, 2014 21:33
Show Gist options
  • Save regnerjr/27b74811ce690021f27b to your computer and use it in GitHub Desktop.
Save regnerjr/27b74811ce690021f27b to your computer and use it in GitHub Desktop.
Horray Fixed in Xcode 6.1.1
//Class methods and initializers that satisfy protocol requirements now properly invoke subclass
//overrides when called in generic contexts. (18828217) For example:
protocol P {
class func foo()
}
class C: P {
class func foo() { println("C!") }
}
class D: C {
override class func foo() { println("D!") }
}
func foo<T: P>(x: T) {
x.dynamicType.foo()
}
foo(C()) // Prints "C!"
foo(D()) // Used to incorrectly print "C!", now prints "D!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment