You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
beccadax opened this issue
Jul 14, 2019
· 2 comments
Labels
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler in itselfparserArea → compiler: The legacy C++ parser
SR-11196 Cannot Reference 'Dictionary.Index' with Dictionary Shorthand Syntax
Issue Description:
This is allowed:
[String: Int].Keys.self
This fails to parse:
letkeys: [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.
The text was updated successfully, but these errors were encountered:
bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler in itselfparserArea → compiler: The legacy C++ parser
Environment
True in at least Swift 5.0 and 5.1.
Additional Detail from JIRA
md5: 2ff725049d085d988e443dcc166c5a65
duplicates:
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.The text was updated successfully, but these errors were encountered: