mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Do not type check lazy accessor bodies eagerly.
Start chipping away at cross-file type checker performance issues by avoiding type checking of lazy property accessor bodies when the type in question is defined in a different file and the lazy property is a typed pattern. We still type check these in the file they are defined in when we go to type check the types defined within that file. Resolves rdar://problem/26894118.
This commit is contained in:
@@ -1625,6 +1625,7 @@ void TypeChecker::completeLazyVarImplementation(VarDecl *VD) {
|
||||
|
||||
// Now that we've got the storage squared away, synthesize the getter.
|
||||
auto *Get = completeLazyPropertyGetter(VD, Storage, *this);
|
||||
validateDecl(Get);
|
||||
|
||||
// The setter just forwards on to storage without materializing the initial
|
||||
// value.
|
||||
@@ -1643,12 +1644,6 @@ void TypeChecker::completeLazyVarImplementation(VarDecl *VD) {
|
||||
Storage->setImplicit();
|
||||
Storage->setAccessibility(Accessibility::Private);
|
||||
Storage->setSetterAccessibility(Accessibility::Private);
|
||||
|
||||
typeCheckDecl(Get, true);
|
||||
typeCheckDecl(Get, false);
|
||||
|
||||
typeCheckDecl(Set, true);
|
||||
typeCheckDecl(Set, false);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user