-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Closed as duplicate of#44398
Closed as duplicate of#44398
Copy link
Labels
TypeResolverbugA 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 itselfexpressionsFeature: expressionsFeature: expressionsgenericsFeature: generic declarations and typesFeature: generic declarations and typesswift 6.0swift evolution proposal neededFlag → feature: A feature that warrants a Swift evolution proposalFlag → feature: A feature that warrants a Swift evolution proposaltype checkerArea → compiler: Semantic analysisArea → compiler: Semantic analysistype inferenceFeature: type inferenceFeature: type inferenceunexpected errorBug: Unexpected errorBug: Unexpected error
Description
Previous ID | SR-10765 |
Radar | None |
Original Reporter | maksg (JIRA User) |
Type | Bug |
Status | Resolved |
Resolution | Duplicate |
Environment
Swift 5.0
Xcode 10.2.1
Additional Detail from JIRA
Votes | 0 |
Component/s | |
Labels | Bug |
Assignee | None |
Priority | Medium |
md5: 4ef4648cb13e4d417b57984575a652b0
duplicates:
Issue Description:
extension Dictionary {
func dict() {
let digitWords = ["one", "two", "three", "four", "five"]
let wordToValue = Dictionary(uniqueKeysWithValues: zip(digitWords, 1...5))
}
}
The above code generates the following error:
Generic parameter 'Sequence1' could not be inferred
This can only be avoided by explicitly saying that I want to use Swift.Dictionary
Metadata
Metadata
Assignees
Labels
TypeResolverbugA 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 itselfexpressionsFeature: expressionsFeature: expressionsgenericsFeature: generic declarations and typesFeature: generic declarations and typesswift 6.0swift evolution proposal neededFlag → feature: A feature that warrants a Swift evolution proposalFlag → feature: A feature that warrants a Swift evolution proposaltype checkerArea → compiler: Semantic analysisArea → compiler: Semantic analysistype inferenceFeature: type inferenceFeature: type inferenceunexpected errorBug: Unexpected errorBug: Unexpected error