@@ -1633,8 +1633,6 @@ static AccessorDecl *createGetterPrototype(AbstractStorageDecl *storage,
1633
1633
ASTContext &ctx) {
1634
1634
SourceLoc loc = storage->getLoc ();
1635
1635
1636
- GenericEnvironment *genericEnvironmentOfLazyAccessor = nullptr ;
1637
-
1638
1636
ParamDecl *selfDecl = nullptr ;
1639
1637
if (storage->getDeclContext ()->isTypeContext ()) {
1640
1638
if (storage->getAttrs ().hasAttribute <LazyAttr>()) {
@@ -1645,8 +1643,6 @@ static AccessorDecl *createGetterPrototype(AbstractStorageDecl *storage,
1645
1643
bindingDecl->getPatternEntryForVarDecl (varDecl).getInitContext ());
1646
1644
1647
1645
selfDecl = bindingInit->getImplicitSelfDecl ();
1648
- genericEnvironmentOfLazyAccessor =
1649
- bindingInit->getGenericEnvironmentOfContext ();
1650
1646
}
1651
1647
}
1652
1648
@@ -1675,18 +1671,6 @@ static AccessorDecl *createGetterPrototype(AbstractStorageDecl *storage,
1675
1671
if (selfDecl)
1676
1672
*getter->getImplicitSelfDeclStorage () = selfDecl;
1677
1673
1678
- // We need to install the generic environment here because:
1679
- // 1) validating the getter will change the implicit self decl's DC to it,
1680
- // 2) it's likely that the initializer will be type-checked before the
1681
- // accessor (and therefore before the normal installation happens), and
1682
- // 3) type-checking a reference to the self decl will map its type into
1683
- // its context, which requires an environment to be installed on that
1684
- // context.
1685
- // We can safely use the enclosing environment because properties are never
1686
- // differently generic.
1687
- if (genericEnvironmentOfLazyAccessor)
1688
- getter->setGenericEnvironment (genericEnvironmentOfLazyAccessor);
1689
-
1690
1674
if (storage->isGetterMutating ())
1691
1675
getter->setSelfAccessKind (SelfAccessKind::Mutating);
1692
1676
else
0 commit comments