Details
-
Type:
Bug
-
Status: In Progress
-
Priority:
Medium
-
Resolution: Unresolved
-
Component/s: Compiler
-
Labels:
-
Radar URL:
Description
We currently consider functions that attempt to overload with an implicitly unwrapped optional and a plain optional to be redeclarations of each other and emit an error
func test1(i: Int?) {} // 'test1(i:)' previously declared here func test1(i: Int!) {} // error: invalid redeclaration of 'test1(i:)'
There used to be a note in Swift 4.1 about how these redeclarations only differed in optionality, but it was removed here https://github.com/apple/swift/commit/f08823757ae39ef7b6ad5b1eb2d7f50942b3f689
We should really add it back, it was helpful.