mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Sema: implement requiresClass using a request evaluator.
Add the request `ProtocolRequiresClassRequest` to lazily determine if a `ProtocolDecl` requires conforming types to be a class. Note that using the request evaluator to compute `requiresClass` introduces cycle errors for protocol declarations, where this computation didn't previously emit diagnostics. For now, we'll allow duplicate diagnostics in this case, with the eventual goal of removing explicitly checking for cycles via `checkCircularity` (instead letting the request evaluator handle cycle diagnostics).
This commit is contained in:
@@ -3323,7 +3323,8 @@ public:
|
||||
None, /*TrailingWhere=*/nullptr);
|
||||
declOrOffset = proto;
|
||||
|
||||
proto->setRequiresClass(isClassBounded);
|
||||
ctx.evaluator.cacheOutput(ProtocolRequiresClassRequest{proto},
|
||||
std::move(isClassBounded));
|
||||
proto->setExistentialTypeSupported(existentialTypeSupported);
|
||||
|
||||
if (auto accessLevel = getActualAccessLevel(rawAccessLevel)) {
|
||||
|
||||
Reference in New Issue
Block a user