Skip to content

Conversation

@jrose-apple
Copy link
Contributor

Targeted fix for SR-2673: if a potential protocol witness is @NSManaged, add accessors the NSManaged way, not the stored property way.

There's probably more weirdness around here, so I'll clone the bug to go through maybeAddAccessorsToVariable a lot more often. (Lazy properties could easily be broken in the same way.)

Targeted fix for SR-2673: if a potential protocol witness is
@NSManaged, add accessors the NSManaged way, not the stored property
way.

There's probably more weirdness around here, so I'll clone the bug to
go through maybeAddAccessorsToVariable a lot more often. (Lazy
properties could easily be broken in the same way.)
@jrose-apple
Copy link
Contributor Author

@swift-ci Please test macOS platform

@jrose-apple
Copy link
Contributor Author

@swift-ci Please smoke test Linux platform

@jrose-apple
Copy link
Contributor Author

@DougGregor or @jckarter, can you review this for the swift-3.0-branch? (Since it is a 3.0 regression.)

@slavapestov
Copy link
Contributor

What's the right fix long-term? It seems like maybeAddAccessorsToVariable() and addTrivialAccessorsToStorage() should be one and the same.

@jrose-apple
Copy link
Contributor Author

Yep. Right now maybeAddAccessorsToVariable is a little too smart, though, and I don't feel comfortable cherry-picking changes to that method to the 3.0 branch.

@jrose-apple
Copy link
Contributor Author

(The current method synthesizes accessors for implicit decls and for imported decls; if we don't want that behavior we should think about all the places we're using it.)

@slavapestov
Copy link
Contributor

In 2.2 I changed things so that all stored properties get synthesized accessors. Do you mind cleaning this up in master, and figuring out the right behavior in general?

@jrose-apple
Copy link
Contributor Author

I'm happy to do that later. This is a targeted fix for Swift 3.

(I made the clone, SR-2874.)

@jrose-apple
Copy link
Contributor Author

Merging in order to kick off the 3.0 build soon, but still waiting on review. (Unless Slava is signing off on it?)

@jrose-apple jrose-apple merged commit 764bf83 into swiftlang:master Oct 6, 2016
@jrose-apple jrose-apple deleted the NSManaged-witnesses branch October 6, 2016 16:44
jrose-apple added a commit to jrose-apple/swift that referenced this pull request Oct 6, 2016
…tlang#5141)

Targeted fix for SR-2673: if a potential protocol witness is
@NSManaged, add accessors the NSManaged way, not the stored property
way.

There's probably more weirdness around here, so I'll clone the bug to
go through maybeAddAccessorsToVariable a lot more often. (Lazy
properties could easily be broken in the same way.)
@DougGregor
Copy link
Member

I'm okay with this targeted fix for Swift 3, but we definitely should clean this up on master.

@jckarter
Copy link
Contributor

jckarter commented Oct 6, 2016

LGTM as a quick fix for 3 as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants