mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[NCGenerics] only print ~Copyable in interface
We can't simply emit the desugared, expanded version of the requirements because there's no way to pretty-print the type `some ~Copyable` when the `~Copyable`'s get replaced with the absence of `Copyable`. We'd be left with just `some _` or need to invent a new top type so we can write `some Top`. Thus, it's best to simply reverse the expansion of default requirements when emitting a swiftinterface file.
This commit is contained in:
@@ -704,6 +704,13 @@ public:
|
||||
inherited->isSpecificProtocol(KnownProtocolKind::Actor))
|
||||
return TypeWalker::Action::SkipChildren;
|
||||
|
||||
// Do not synthesize an extension to print a conformance to an
|
||||
// invertible protocol, as their conformances are always re-inferred
|
||||
// using the interface itself.
|
||||
if (auto kp = inherited->getKnownProtocolKind())
|
||||
if (getInvertibleProtocolKind(*kp))
|
||||
return TypeWalker::Action::SkipChildren;
|
||||
|
||||
if (inherited->isSPI() && printOptions.printPublicInterface())
|
||||
return TypeWalker::Action::Continue;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user