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-8814 GenericSignatureBuilder should re-introduce conformance requirements when adding a superclass requirement
Issue Description:
Description
A protocol with an associated type requirement that has a function declared that does not utilize this requirement will cause a segmentation fault during compilation if there exists an extension that provides an implementation of this method.
Note: This behavior seems to be observed only when adopting the protocol in a generic class, and the class does not itself provide an implementation of said function.
TL/DR Workarounds: Using type aliasing to conform to the protocol instead of declaring the class as generic solves the issue, as does providing a default implementation in the generic class.
Playground for experimentation and reproduction attached!
Feedback ID: FB7624146
Reproduction Setup
Create protocol that has an associated type requirement
Declare two function signatures in protocol
Function signature one with a parameter that has the associated type
Function signature two as a void function (more specifically any function signature omitting that associated type)
Declare an extension to the protocol
Provide default implementation for both methods
Declare a generic class that conforms to the protocol and declares associated type in its declaration (not using a type alias)
Attachment: Download
Environment
Tools
Xcode 11.3.1
Swift 5.1.3
System
macOS 10.15.2
iOS 13.2 SDK
Additional Detail from JIRA
md5: 59efa67ae8051b28e1474cd71a947d21
duplicates:
Issue Description:
Description
A protocol with an associated type requirement that has a function declared that does not utilize this requirement will cause a segmentation fault during compilation if there exists an extension that provides an implementation of this method.
Note: This behavior seems to be observed only when adopting the protocol in a generic class, and the class does not itself provide an implementation of said function.
TL/DR Workarounds: Using type aliasing to conform to the protocol instead of declaring the class as generic solves the issue, as does providing a default implementation in the generic class.
Playground for experimentation and reproduction attached!
Feedback ID: FB7624146
Reproduction Setup
Create protocol that has an associated type requirement
Declare two function signatures in protocol
Function signature one with a parameter that has the associated type
Function signature two as a void function (more specifically any function signature omitting that associated type)
Declare an extension to the protocol
Declare a generic class that conforms to the protocol and declares associated type in its declaration (not using a type alias)
Results
You will receive a segmentation fault.
Example of Failure
Workaround 1: Generic class provides implementation
Workaround 2: Declare type alias in basic class instead of declaring a generic class
The text was updated successfully, but these errors were encountered: