Last active
February 20, 2017 19:10
-
-
Save cassdeckard/3963022c80b83b6357b312a56e0b356b to your computer and use it in GitHub Desktop.
Potential bug in Swift compiler?
This file contains hidden or 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
| import Foundation | |
| public class BaseClass<H> { | |
| public init?() { | |
| } | |
| } |
This file contains hidden or 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
| import Foundation | |
| public class ClassA: BaseClass<Int> { | |
| // NOTE: Uncommenting this makes the error go away. Why??? | |
| //public convenience init?(_ whatever: Int) { fatalError() } | |
| } |
This file contains hidden or 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
| import Foundation | |
| public class ClassB: BaseClass<Bool> { | |
| public func makeA() -> ClassA? { | |
| return ClassA() // error: '() -> ClassA' is not convertible to '() -> ClassA?' | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment