mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Make sure we validate the synthesized accessors for NSManaged properties.
(as well as those for lazy properties, which seem to be working already) This fixes a problem with @NSManaged properties being declared in an extension in a generated file you're not supposed to modify, which unfortunately is exactly how Xcode's generating them these days. rdar://problem/20821582 Swift SVN r28180
This commit is contained in:
@@ -1569,6 +1569,9 @@ static void convertNSManagedStoredVarToComputed(VarDecl *VD, TypeChecker &TC) {
|
||||
// Okay, we have both the getter and setter. Set them in VD.
|
||||
VD->makeComputed(VD->getLoc(), Get, Set, nullptr, VD->getLoc());
|
||||
|
||||
TC.validateDecl(Get);
|
||||
TC.validateDecl(Set);
|
||||
|
||||
// We've added some members to our containing class/extension, add them to
|
||||
// the members list.
|
||||
addMemberToContextIfNeeded(Get, VD->getDeclContext());
|
||||
@@ -1840,7 +1843,9 @@ void swift::maybeAddAccessorsToVariable(VarDecl *var, TypeChecker &TC) {
|
||||
var->makeComputed(var->getLoc(), getter, setter, nullptr,
|
||||
var->getLoc());
|
||||
var->setIsBeingTypeChecked(false);
|
||||
TC.computeAccessibility(setter);
|
||||
|
||||
TC.validateDecl(getter);
|
||||
TC.validateDecl(setter);
|
||||
|
||||
addMemberToContextIfNeeded(getter, var->getDeclContext());
|
||||
addMemberToContextIfNeeded(setter, var->getDeclContext());
|
||||
|
||||
Reference in New Issue
Block a user