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
SR-5865 Key path expression is "ambiguous without more context"
Issue Description:
KeyPath subscripts are nice! Just came across a small gotcha: abbreviated syntax doesn't seem to compile.
letarr = [1, 2, 3]
arr[keyPath: \[Int].[0]]
arr[keyPath: \Array.[0]]
// both return 1arr[keyPath: \.[0]]
// error: type of expression is ambiguous without more context
(Also still seeing the "Key path support for subscript components is not implemented" diagnostic popping up in Xcode, but things build and work just fine, so maybe this is an Xcode bug/artifact.)
The text was updated successfully, but these errors were encountered:
Still seeing this. It only seems to be ambiguous when passed to the key path subscript proper. Key paths are awesome and though the abbreviation is mostly helpful outside the direct subscript syntax, it'd be awesome to be consistent here for teaching purposes 🙂
Environment
Xcode 9, Swift Development Snapshot (9/22/2017)
Additional Detail from JIRA
md5: 3e38e7bce2da1329ef063d4a9ae3c2cb
duplicates:
Issue Description:
KeyPath subscripts are nice! Just came across a small gotcha: abbreviated syntax doesn't seem to compile.
(Also still seeing the "Key path support for subscript components is not implemented" diagnostic popping up in Xcode, but things build and work just fine, so maybe this is an Xcode bug/artifact.)
The text was updated successfully, but these errors were encountered: