@@ -7992,8 +7992,6 @@ static void finalizeType(TypeChecker &TC, NominalTypeDecl *nominal) {
7992
7992
assert (!nominal->hasClangNode ());
7993
7993
assert (isa<SourceFile>(nominal->getModuleScopeContext ()));
7994
7994
7995
- Optional<bool > lazyVarsAlreadyHaveImplementation;
7996
-
7997
7995
if (auto *classDecl = dyn_cast<ClassDecl>(nominal))
7998
7996
TC.requestSuperclassLayout (classDecl);
7999
7997
@@ -8008,31 +8006,14 @@ static void finalizeType(TypeChecker &TC, NominalTypeDecl *nominal) {
8008
8006
TC.validateDecl (VD);
8009
8007
8010
8008
// The only thing left to do is synthesize storage for lazy variables.
8011
- // We only have to do that if it's a type from another file, though.
8012
- // In NDEBUG builds, bail out as soon as we can.
8013
- #ifdef NDEBUG
8014
- if (lazyVarsAlreadyHaveImplementation.hasValue () &&
8015
- lazyVarsAlreadyHaveImplementation.getValue ())
8016
- continue ;
8017
- #endif
8018
8009
auto *prop = dyn_cast<VarDecl>(D);
8019
8010
if (!prop)
8020
8011
continue ;
8021
8012
8022
8013
if (prop->getAttrs ().hasAttribute <LazyAttr>() && !prop->isStatic ()
8023
8014
&& prop->getGetter ()) {
8024
- bool hasImplementation = prop->getGetter ()->hasBody ();
8025
-
8026
- if (lazyVarsAlreadyHaveImplementation.hasValue ()) {
8027
- assert (lazyVarsAlreadyHaveImplementation.getValue () ==
8028
- hasImplementation &&
8029
- " only some lazy vars already have implementations" );
8030
- } else {
8031
- lazyVarsAlreadyHaveImplementation = hasImplementation;
8032
- }
8033
-
8034
- if (!hasImplementation)
8035
- TC.completeLazyVarImplementation (prop);
8015
+ assert (!prop->getGetter ()->hasBody ());
8016
+ TC.completeLazyVarImplementation (prop);
8036
8017
}
8037
8018
}
8038
8019
0 commit comments