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-14041 Protocol allows to create a nested enum without explicit indirect keyword resulting in a runtime crash
Issue Description:
When using an (enum case with a reference-type associated value) as a protocol witness, the Swift compiler appears to be using incorrect ARC semantics while passing the associated value argument, resulting in an over-release or memory leak of the passed object.
Environment
Operating System: macOS Big Sur 11.1 (20C69)
Toolchain: Xcode 12.3 (12C33)
Target Platform: macOS
Additional Detail from JIRA
md5: ec3380d9c01408ad14573d2d139a63ff
duplicates:
indirect
keyword resulting in a runtime crashIssue Description:
When using an (enum case with a reference-type associated value) as a protocol witness, the Swift compiler appears to be using incorrect ARC semantics while passing the associated value argument, resulting in an over-release or memory leak of the passed object.
For example:
Furthermore, using a regular static method as a protocol witness fixes the issue:
The text was updated successfully, but these errors were encountered: