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-6507] Encodable in combination with class inheritance and computed properties generates unexpected behaviour #49057

Closed
swift-ci opened this issue Nov 30, 2017 · 5 comments
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. Codable Area → standard library: `Codable` and co. compiler The Swift compiler in itself

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-6507
Radar https://bugreport.apple.com/web/?problemID=35647420
Original Reporter KhriapinD (JIRA User)
Type Bug
Status Resolved
Resolution Duplicate

Attachment: Download

Environment

Xcode version 9.1 (9B55), Swift 4

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, Codable
Assignee @itaiferber
Priority Medium

md5: d6bee7e70cb8a9e38370c83d2289707c

duplicates:

  • SR-6468 inheriting from class with synthesized Codable implementation creates invalid code

Issue Description:

Accessing computed property with optional type may result in EXC_BAD_ACCESS crash

or more complex unexpected behavior in case additional methods are implemented in the class.

. Conditions:

1. Base class that confirms to Encodable protocol.

2. Subclass with a computed optional property that inherits from the base class.

3. Both classes in a different file than UIViewController that uses them.

4. Conditional binding to computed property.

Please check demo project attached.

@belkadan
Copy link
Contributor

@itaiferber, I think you already have one of these?

@itaiferber
Copy link
Contributor

@belkadan Yes, this appears to be related to rdar://problem/34778050 (not publicly filed I don't think); will related the Radars

@swift-ci
Copy link
Collaborator Author

Comment by Rishabh Tayal (JIRA)

Any update on this issue? I am facing the same crash.

@belkadan
Copy link
Contributor

Consolidating.

@AnnaZaks
Copy link
Mannequin

AnnaZaks mannequin commented Jul 25, 2018

KhriapinD (JIRA User), Could you verify that the problem is solved and if so, move the bug to "Closed" state?

Thanks,
Anna

@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. Codable Area → standard library: `Codable` and co. compiler The Swift compiler in itself
Projects
None yet
Development

No branches or pull requests

3 participants