-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Open
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfThe Swift compiler itselftuplesFeature: tuplesFeature: tuplestype checkerArea → compiler: Semantic analysisArea → compiler: Semantic analysis
Description
The following fails to compile with a bad diagnostic:
func foo(_ i: Int) {
let _: (Int, (x: Int, Bool))? = true ? (i, (i, true)) : nil
// error: type of expression is ambiguous without a type annotation
}
However if you remove the first element i
and the associated Int
from the type annotation, it succeeds. It also succeeds if you remove the ternary.
tayloraswift and dnadoba
Metadata
Metadata
Assignees
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.A deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfThe Swift compiler itselftuplesFeature: tuplesFeature: tuplestype checkerArea → compiler: Semantic analysisArea → compiler: Semantic analysis