Last active
March 31, 2016 09:49
-
-
Save devxoul/b5ac688ffcf70fc9222892c267319ce5 to your computer and use it in GitHub Desktop.
Overridden function is not being called when sublassing generic class in Release Build with Whole Module Optimization. https://bugs.swift.org/browse/SR-1117
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// A generic class | |
class Parent<T> { | |
func printName() { | |
print(self.name()) | |
} | |
func name() -> String { | |
return "Parent" | |
} | |
} | |
/// Subclass of generic class | |
class Child: Parent<String> { | |
/// This method is not being called with Release Build + Whole Module Optimization. | |
override func name() -> String { | |
return "Child" | |
} | |
} | |
let child = Child() | |
child.printName() // expected "Child" but prints "Parent" with Release Build + Whole Module Optimization. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment