Skip to content

Conversation

@jrose-apple
Copy link
Contributor

@jrose-apple jrose-apple commented Oct 6, 2016

  • Explanation: Protocol requirements force accessors to be synthesized even for stored properties, but the compiler is doing this in a very unconditional way. A particular symptom of this was that @NSManaged properties, which look like stored properties syntactically, would be incorrectly turned into "true" stored properties if they were used to satisfy protocol requirements, after which the compiler would turn around and mark those properties as errors. This is a targeted patch to fix that by sending NSManaged properties down their normal path for getting accessors.
  • Scope: Only affects NSManaged properties that satisfy protocol requirements.
  • Issue: SR-2673
  • Reviewed by: @DougGregor
  • Risk: Low.
  • Testing: Added a compiler regression test, manually verified that the code in the bug report now builds.

…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.)
@jrose-apple
Copy link
Contributor Author

@swift-ci Please test

@ematejska ematejska merged commit 10e900a into swiftlang:swift-3.0-branch Oct 7, 2016
@jrose-apple jrose-apple deleted the swift-3-NSManaged-witness branch October 7, 2016 16:56
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.

2 participants