Skip to content

Commit 87be387

Browse files
committed
Sema: validateDecl validates the context of GenericTypeParamDecls
1 parent d81a5d6 commit 87be387

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/Sema/TypeCheckDecl.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3640,10 +3640,6 @@ static Type buildAddressorResultType(TypeChecker &TC,
36403640
}
36413641

36423642
void TypeChecker::validateDecl(ValueDecl *D) {
3643-
// Generic parameters are validated as part of their context.
3644-
if (isa<GenericTypeParamDecl>(D))
3645-
return;
3646-
36473643
// Handling validation failure due to re-entrancy is left
36483644
// up to the caller, who must call hasValidSignature() to
36493645
// check that validateDecl() returned a fully-formed decl.
@@ -3681,6 +3677,10 @@ void TypeChecker::validateDecl(ValueDecl *D) {
36813677
return;
36823678
}
36833679

3680+
// Generic parameters are validated as part of their context.
3681+
if (isa<GenericTypeParamDecl>(D))
3682+
return;
3683+
36843684
// Validating the parent may have triggered validation of this declaration,
36853685
// so just return if that was the case.
36863686
if (D->hasValidationStarted()) {

0 commit comments

Comments
 (0)