mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Sema] initial overhaul of isNoncopyable
This implementation has the function execute a request to scan the inheritance clause of non-protocol nominals for a `~Copyable`. For protocols, we look in the requirement signature. This isn't our final state, as the GenericEnvironment needs to be queried in general to determine of a Type is noncopyable. So for now checking for a `~Copyable` only makes sense for Decls.
This commit is contained in:
@@ -1211,6 +1211,9 @@ static SmallVector<ProtocolConformance *, 2> findSynthesizedConformances(
|
||||
// Concrete types may synthesize some conformances
|
||||
if (!isa<ProtocolDecl>(nominal)) {
|
||||
trySynthesize(KnownProtocolKind::Sendable);
|
||||
|
||||
if (nominal->getASTContext().LangOpts.hasFeature(Feature::NoncopyableGenerics))
|
||||
trySynthesize(KnownProtocolKind::Copyable);
|
||||
}
|
||||
|
||||
/// Distributed actors can synthesize Encodable/Decodable, so look for those
|
||||
|
||||
Reference in New Issue
Block a user