|
|
| Previous ID |
SR-6305 |
| Radar |
rdar://problem/37159993 |
| Original Reporter |
@karwa |
| Type |
Bug |
Environment
Apple Swift version 4.0.3 (swiftlang-900.0.71 clang-900.0.38)
Target: x86_64-apple-macosx10.9
Additional Detail from JIRA
|
|
| Votes |
0 |
| Component/s |
Compiler |
| Labels |
Bug, TypeChecker |
| Assignee |
@xedin |
| Priority |
Medium |
md5: a219796b79b304ec98d478ac6a4adc11
is duplicated by:
- SR-6905 Dictionary(uniqueKeysWithValues:) does not accept sequence of labeled tuples
Issue Description:
The following snippet fails to compile:
let test = Dictionary(uniqueKeysWithValues: ["a", "b", "c"].enumerated())
With the message:
Cannot invoke initializer for type 'Dictionary<_, _>' with an argument list of type '(uniqueKeysWithValues: EnumeratedSequence<[String]>)'
The only way I was able to get it to work was to add a pass-through call to "map" on the end:
let test = Dictionary(uniqueKeysWithValues: ["a", "b", "c"].enumerated().map { $0 })
Environment
Apple Swift version 4.0.3 (swiftlang-900.0.71 clang-900.0.38)
Target: x86_64-apple-macosx10.9
Additional Detail from JIRA
md5: a219796b79b304ec98d478ac6a4adc11
is duplicated by:
Issue Description:
The following snippet fails to compile:
With the message:
The only way I was able to get it to work was to add a pass-through call to "map" on the end: