Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-14644] Incorrect error message when making function calls in keypath literal #56996

Closed
swift-ci opened this issue May 18, 2021 · 1 comment
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself diagnostics QoI Bug: Diagnostics Quality of Implementation type checker Area → compiler: Semantic analysis

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-14644
Radar None
Original Reporter cukier (JIRA User)
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, DiagnosticsQoI, TypeChecker
Assignee @LucianoPAlmeida
Priority Medium

md5: 73a377b893a4dab34ff0158768ba72bf

Issue Description:

let kp = \Int.byteSwapped.byteSwapped.signum()

The code above generates two diagnostics, the second one is invalid because I have more than one components in the keypath, even if you don't count the invalid one

<source>:1:39: error: invalid component of Swift key path
let kp = \Int.byteSwapped.byteSwapped.signum()
                                      ^
<source>:1:10: error: key path must have at least one component
let kp = \Int.byteSwapped.byteSwapped.signum()
         ^

(in 5.3 the error was talking about adding explicit type to the keypath, even though the type is explicit already)

@LucianoPAlmeida
Copy link
Collaborator

Fixed on master by #37521
cukier (JIRA User) Can you please verify on next available snapshot and close. Thanks

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself diagnostics QoI Bug: Diagnostics Quality of Implementation type checker Area → compiler: Semantic analysis
Projects
None yet
Development

No branches or pull requests

2 participants