Skip to content

Mechanically add 'open' to all public classes. #499

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 1, 2016

Conversation

jrose-apple
Copy link
Contributor

This applies open to all public classes and all of their non-final public methods, properties, and subscripts, preserving the existing behavior when SE-0117 is implemented. This transformation was performed mechanically using the following sed script (run with sed -E):

/(init|mutating|struct|enum|typealias|final|let|static)/ {
  p
  d
}
/public class/,/^}/ s/public/open/

This should probably be refined soon, but for now this allows us to implement SE-0117 without immediately requiring updates in all clients. Specifically, there are two areas where this change may not be correct to match Foundation on Apple platforms:

  • Members in extensions cannot yet be overridden, so none of them have been marked open.
  • Some classes are not intended to be overridden, even in Objective-C. Specifying this requires input from the Foundation team.

Groundwork for SE-0117 "Allow distinguishing between public access and public overridability"

This applies 'open' to all public classes and all of their non-final
public methods, properties, and subscripts, preserving the existing
behavior when SE-0117 is implemented. This transformation was performed
mechanically using the following sed script (run with sed -E):

  /(init|mutating|struct|enum|typealias|final|let|static)/ {
    p
    d
  }
  /public class/,/^}/ s/public/open/

This should probably be refined soon, but for now this allows us to
implement SE-0117 without immediately requiring updates in all
clients. Specifically, there are two areas where this change may not
be correct to match Foundation on Apple platforms:

- Members in extensions cannot yet be overridden, so none of them have
  been marked 'open'.
- Some classes are /not/ intended to be overridden, even in Objective-C.
  Specifying this requires input from the Foundation team.

Groundwork for SE-0117 "Allow distinguishing between public access and
public overridability"
@jrose-apple
Copy link
Contributor Author

cc @parkera, @rjmccall

@swift-ci Please test

@jrose-apple
Copy link
Contributor Author

@swift-ci Please test

@jrose-apple
Copy link
Contributor Author

Ah, this may not work without swiftlang/swift-corelibs-xctest#150.

@rjmccall
Copy link
Contributor

rjmccall commented Aug 1, 2016

I've pulled the xctest change, so we'll just merge this as well. Thanks!

@rjmccall rjmccall merged commit 76542be into swiftlang:master Aug 1, 2016
@jrose-apple jrose-apple deleted the open-for-business branch August 1, 2016 22:51
kateinoigakukun pushed a commit to kateinoigakukun/swift-corelibs-foundation that referenced this pull request Oct 11, 2023
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