mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Sema: Remove DeclChecker::IsSecondPass
The DeclChecker had three possible states: - IsFirstPass true, IsSecondPass false. This is the 'first pass' for declarations that appear at the top-level, or are nested inside top-level types. - IsFirstPass false, IsSecondPass true. This is the 'second pass' for declarations that appear at the top-level, or are nested inside top-level types. - IsFirstPass false, IsSecondPass false. This was used for (some) local declarations. This is unnecessarily confusing. We can eliminate the third state by calling typeCheckDecl() twice in a few places. This allows IsSecondPass to be removed entirely since it's now always equal to !IsFirstPass.
This commit is contained in:
@@ -1975,7 +1975,7 @@ ConstructorDecl *swift::createImplicitConstructor(TypeChecker &tc,
|
||||
}
|
||||
|
||||
// Type-check the constructor declaration.
|
||||
tc.typeCheckDecl(ctor, /*isFirstPass=*/true);
|
||||
tc.validateDecl(ctor);
|
||||
|
||||
return ctor;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user