@@ -28,6 +28,7 @@ using namespace swift;
28
28
// / Create a property declaration and inject it into the given type.
29
29
static VarDecl *injectProperty (NominalTypeDecl *parent, Identifier name,
30
30
Type type, VarDecl::Introducer introducer,
31
+ AccessLevel accessLevel,
31
32
Expr *initializer = nullptr ) {
32
33
auto &ctx = parent->getASTContext ();
33
34
@@ -36,7 +37,7 @@ static VarDecl *injectProperty(NominalTypeDecl *parent, Identifier name,
36
37
37
38
var->setImplicit ();
38
39
var->setSynthesized ();
39
- var->copyFormalAccessFrom (parent, /* sourceIsParentContext= */ true );
40
+ var->setAccess (accessLevel );
40
41
var->setInterfaceType (type);
41
42
42
43
Pattern *pattern = NamedPattern::createImplicit (ctx, var);
@@ -193,8 +194,8 @@ GetTypeWrapperProperty::evaluate(Evaluator &evaluator,
193
194
typeWrapper, /* Parent=*/ typeWrapperType->getParent (),
194
195
/* genericArgs=*/ {storage->getInterfaceType ()->getMetatypeInstanceType ()});
195
196
196
- return injectProperty (parent, ctx.Id_TypeWrapperProperty ,
197
- propertyTy, VarDecl::Introducer::Var);
197
+ return injectProperty (parent, ctx.Id_TypeWrapperProperty , propertyTy,
198
+ VarDecl::Introducer::Var, AccessLevel::Private );
198
199
}
199
200
200
201
VarDecl *GetTypeWrapperStorageForProperty::evaluate (Evaluator &evaluator,
@@ -215,7 +216,7 @@ VarDecl *GetTypeWrapperStorageForProperty::evaluate(Evaluator &evaluator,
215
216
216
217
return injectProperty (storage, property->getName (),
217
218
property->getValueInterfaceType (),
218
- property->getIntroducer ());
219
+ property->getIntroducer (), AccessLevel::Internal );
219
220
}
220
221
221
222
// / Given the property create a subscript to reach its type wrapper storage:
0 commit comments