@@ -2153,19 +2153,6 @@ OpaqueReadOwnershipRequest::evaluate(Evaluator &evaluator,
2153
2153
: OpaqueReadOwnership::Owned);
2154
2154
}
2155
2155
2156
- static void validateAbstractStorageDecl (TypeChecker &TC,
2157
- AbstractStorageDecl *storage) {
2158
- if (storage->getOpaqueResultTypeDecl ()) {
2159
- if (auto sf = storage->getInnermostDeclContext ()->getParentSourceFile ()) {
2160
- sf->markDeclWithOpaqueResultTypeAsValidated (storage);
2161
- }
2162
- }
2163
-
2164
- // Everything else about the accessors can wait until finalization.
2165
- // This will validate all the accessors.
2166
- TC.DeclsToFinalize .insert (storage);
2167
- }
2168
-
2169
2156
// / Check the requirements in the where clause of the given \c source
2170
2157
// / to ensure that they don't introduce additional 'Self' requirements.
2171
2158
static void checkProtocolSelfRequirements (ProtocolDecl *proto,
@@ -3975,8 +3962,11 @@ void TypeChecker::validateDecl(ValueDecl *D) {
3975
3962
checkDeclAttributesEarly (VD);
3976
3963
validateAttributes (*this , VD);
3977
3964
3978
- // Perform accessor-related validation.
3979
- validateAbstractStorageDecl (*this , VD);
3965
+ if (VD->getOpaqueResultTypeDecl ()) {
3966
+ if (auto SF = VD->getInnermostDeclContext ()->getParentSourceFile ()) {
3967
+ SF->markDeclWithOpaqueResultTypeAsValidated (VD);
3968
+ }
3969
+ }
3980
3970
3981
3971
break ;
3982
3972
}
@@ -4254,7 +4244,11 @@ void TypeChecker::validateDecl(ValueDecl *D) {
4254
4244
}
4255
4245
4256
4246
// Perform accessor-related validation.
4257
- validateAbstractStorageDecl (*this , SD);
4247
+ if (SD->getOpaqueResultTypeDecl ()) {
4248
+ if (auto SF = SD->getInnermostDeclContext ()->getParentSourceFile ()) {
4249
+ SF->markDeclWithOpaqueResultTypeAsValidated (SD);
4250
+ }
4251
+ }
4258
4252
4259
4253
break ;
4260
4254
}
@@ -4523,12 +4517,9 @@ static void finalizeType(TypeChecker &TC, NominalTypeDecl *nominal) {
4523
4517
forceConformance (TC.Context .getProtocol (KnownProtocolKind::Hashable));
4524
4518
}
4525
4519
4526
- // validateDeclForNameLookup will not trigger an immediate full
4527
- // validation of protocols, but clients will assume that things
4528
- // like the requirement signature have been set.
4529
4520
if (auto PD = dyn_cast<ProtocolDecl>(nominal)) {
4530
- ( void ) PD->getInheritedProtocols ();
4531
- TC.validateDecl (PD );
4521
+ for ( auto *inherited : PD->getInheritedProtocols ())
4522
+ TC.requestNominalLayout (inherited );
4532
4523
}
4533
4524
}
4534
4525
0 commit comments