[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:
Kavon Farvardin
2023-09-25 14:15:59 -07:00
parent 578db55c4c
commit d5f2d54ca7
21 changed files with 349 additions and 48 deletions

View File

@@ -4838,7 +4838,7 @@ GenericParameterReferenceInfo ValueDecl::findExistentialSelfReferences(
bool TypeDecl::isNoncopyable() const {
return evaluateOrDefault(getASTContext().evaluator,
IsNoncopyableRequest{const_cast<TypeDecl *>(this)},
getAttrs().hasAttribute<MoveOnlyAttr>());
true); // default to true for safety
}
Type TypeDecl::getDeclaredInterfaceType() const {