[SR-7078] Swift 4.1 Type Checker: Ambiguous init #49626
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
regression
swift 4.1
type checker
Area → compiler: Semantic analysis
Environment
Xcode 9.3 beta 3 (and tried swift-DEVELOPMENT-SNAPSHOT-2018-02-25-a)
macOS 10.13.3
Additional Detail from JIRA
md5: 084197e72d572e4b37aaf525ea44cb15
Issue Description:
I've found a case where Swift 4.0's type checker doesn't error, but Swift 4.1 can't decide which init to use. That said, I can only reproduce it in our large project in Xcode (so it goes). I've done my best to try to recreate it in a small file, but this file compiles just fine. I'm hoping that by describing this, maybe someone with more knowledge of the type checker will be able to suss out what's going on here:
It failed on the last line trying to decide between the marked candidates 1 and 2 in my larger project. This file compiles fine on its own though.
FWIW, I would expect the type checker to pick candidate 2 because its the most specific, but it appears to pick candidate 3 (in Swift 4.1 and Swift 4.0 in this actual scenario where it compiles and runs fine).
The text was updated successfully, but these errors were encountered: