SR-11196 Cannot Reference 'Dictionary.Index' with Dictionary Shorthand Syntax
Issue Description:
This is allowed:
[String: Int].Keys.self
This fails to parse:
let keys: [String: Int].Keys
Array behaves analogously.
This presumably happens because types in expressions are resolved by special typechecker preprocessing, but these should probably be treated consistently. However, removing the expression form would be source-breaking, and adding the declaration form might be considered a language change requiring Evolution (if it's not an outright bug), so neither solution is completely trivial. Core team members have said that the lack of support in declarations is a bug that can be fixed without an Evolution proposal, but please note the change in the CHANGELOG file.
Environment
True in at least Swift 5.0 and 5.1.Additional Detail from JIRA
| | | |------------------|-----------------| |Votes | 1 | |Component/s | Compiler | |Labels | Bug, Parser | |Assignee | None | |Priority | Medium | md5: 2ff725049d085d988e443dcc166c5a65duplicates:
is duplicated by:
Issue Description:
This is allowed:
This fails to parse:
Array behaves analogously.
This presumably happens because types in expressions are resolved by special typechecker preprocessing, but these should probably be treated consistently.
However, removing the expression form would be source-breaking, and adding the declaration form might be considered a language change requiring Evolution (if it's not an outright bug), so neither solution is completely trivial.Core team members have said that the lack of support in declarations is a bug that can be fixed without an Evolution proposal, but please note the change in the CHANGELOG file.