[SR-3443] Extensions do not preserve sugar (like a typealias) of their base type #46031
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
compiler
The Swift compiler in itself
serialization
Area → compiler: Serialization & deserialization
Additional Detail from JIRA
md5: d35dc1c42263a4b5788421755404ad94
Issue Description:
As of #6336 serializing an extension will deliberately desugar its base type first. This works around two issues:
The "right" answer is to (a) check that the typealias is public if the extension has any public members, and (b) somehow ensure there is no circularity issue (either by not importing the extension as a result of importing the typealias, or by the extension being able to set its sugared base type later).
If we ever solve these problems, we should restore the sugar, since it can make the extension clearer for clients of the library. The desugared form might be some unpretty implementation type that's not intended to be used directly.
The text was updated successfully, but these errors were encountered: