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-15271] Improve Codable Diagnostics When CodingKeys Do Not Match Properties #57593

Open
CodaFi opened this issue Oct 1, 2021 · 3 comments
Assignees
Labels
compiler The Swift compiler in itself derived conformances Feature → protocol → conformances: derived conformances aka synthesized conformances diagnostics QoI Bug: Diagnostics Quality of Implementation good first issue Good for newcomers improvement

Comments

@CodaFi
Copy link
Member

CodaFi commented Oct 1, 2021

Previous ID SR-15271
Radar rdar://83771311
Original Reporter @CodaFi
Type Improvement
Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Improvement, DiagnosticsQoI, StarterBug
Assignee None
Priority Medium

md5: 3c54547b3d23d4952661aaf14230a55d

Issue Description:

Consider

struct Foo: Codable {
  var bar: String

  private enum CodingKeys: String, CodingKey {
    case ba
  }
}

What we should have is some kind of notes that explain that the manually-provided CodingKeys are insufficient to satisfy the ad-hoc "nested type requirement" of Codable because of the typo. Instead, all we say is that Foo doesn't conform to Codable.

@CodaFi
Copy link
Member Author

CodaFi commented Oct 1, 2021

Marking as a starter bug, but this one probably requires a little bit of up-front knowledge of the conformance derivation machinery. I'd be happy to bring somebody up to speed here if need be.

@jirid
Copy link
Contributor

jirid commented Oct 21, 2021

WIP: #39825

@swift-ci
Copy link
Collaborator

Comment by Waheed Afolabi (JIRA)

@CodaFi I'd be happy to take this up and hoping you bring me up to speed!

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@jirid jirid self-assigned this Apr 28, 2022
@AnthonyLatsis AnthonyLatsis added the derived conformances Feature → protocol → conformances: derived conformances aka synthesized conformances label Jul 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler The Swift compiler in itself derived conformances Feature → protocol → conformances: derived conformances aka synthesized conformances diagnostics QoI Bug: Diagnostics Quality of Implementation good first issue Good for newcomers improvement
Projects
None yet
Development

No branches or pull requests

4 participants