Skip to content

[stdlib] Mark public classes as 'open'. #3876

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

Depends on #3875 (or the full implementation of open). PR for review by the stdlib team.


Before merging this pull request to apple/swift repository:

  • Test pull request on Swift continuous integration.

Triggering Swift CI

The swift-ci is triggered by writing a comment on this PR addressed to the GitHub user @swift-ci. Different tests will run depending on the specific comment that you use. The currently available comments are:

Smoke Testing

Platform Comment
All supported platforms @swift-ci Please smoke test
All supported platforms @swift-ci Please smoke test and merge
OS X platform @swift-ci Please smoke test OS X platform
Linux platform @swift-ci Please smoke test Linux platform

A smoke test on macOS does the following:

  1. Builds the compiler incrementally.
  2. Builds the standard library only for macOS. Simulator standard libraries and
    device standard libraries are not built.
  3. lldb is not built.
  4. The test and validation-test targets are run only for macOS. The optimized
    version of these tests are not run.

A smoke test on Linux does the following:

  1. Builds the compiler incrementally.
  2. Builds the standard library incrementally.
  3. lldb is built incrementally.
  4. The swift test and validation-test targets are run. The optimized version of these
    tests are not run.
  5. lldb is tested.

Validation Testing

Platform Comment
All supported platforms @swift-ci Please test
All supported platforms @swift-ci Please test and merge
OS X platform @swift-ci Please test OS X platform
OS X platform @swift-ci Please benchmark
Linux platform @swift-ci Please test Linux platform

Lint Testing

Language Comment
Python @swift-ci Please Python lint

Note: Only members of the Apple organization can trigger swift-ci.

@jrose-apple jrose-apple changed the title [stdlib] Mark public classes as 'open'. [REVIEW] [stdlib] Mark public classes as 'open'. Jul 29, 2016
public init() {}
}

@objc @_swift_native_objc_runtime_base(_SwiftNativeNSCharacterSetBase)
public class _SwiftNativeNSCharacterSet {
open class _SwiftNativeNSCharacterSet {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gribozavr, do these need to be open, or just public?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are subclassed in the Foundation module. I would prefer to move them from the core library into the Foundation overlay, but that is a separate project.

Could you add a comment // FIXME(ABI): move into the Foundation overlay and remove 'open'. to each one?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do, thanks for the review.

@jrose-apple
Copy link
Contributor Author

@mwwa, is DispatchWorkItem intended to be subclassed or no?

@mwwa
Copy link
Contributor

mwwa commented Jul 29, 2016

Pretty sure we're aiming for no, though I suspect it never had final added to it (mostly because all the other Dispatch classes can't have final added and it got missed).

@das ?

@jrose-apple
Copy link
Contributor Author

Yeah, I asked because I did a grep for public classes and filtered out the final ones.

@mwwa
Copy link
Contributor

mwwa commented Jul 29, 2016

As an aside, if we could make the other dispatch classes explicitly final then they should be too. I don't think we can do that when the class is defined in ObjC, right? (Even though you generally can't subclass them because of objc_runtime_visible.

@jrose-apple
Copy link
Contributor Author

Yeah, the reason the imported types aren't final is because the compiler will optimize based on that, and it can't prove there aren't any non-public subclasses. I don't think that should rule out marking this one final, though. (Unless you think there might be an internal class hierarchy in the future. That was the whole point of the open proposal.)

@das
Copy link

das commented Jul 30, 2016

@mwwa re DispatchWorkItem, unlike most other Dispatch classes I could see that one being useful to subclass, but I don't think we have the technical ability to do so at this point ?

All other Dispatch classes are not currently intended or able to be subclassed.

@jrose-apple
Copy link
Contributor Author

Okay, it sounds like it's best to leave the possibility open, i.e. leave it as is.

@jrose-apple
Copy link
Contributor Author

@swift-ci Please smoke test

@jrose-apple
Copy link
Contributor Author

@swift-ci Please smoke test

@jrose-apple jrose-apple changed the title [REVIEW] [stdlib] Mark public classes as 'open'. [stdlib] Mark public classes as 'open'. Aug 1, 2016
@jrose-apple
Copy link
Contributor Author

@swift-ci Please smoke test Linux platform

@jrose-apple jrose-apple merged commit 802a0b9 into swiftlang:master Aug 1, 2016
@jrose-apple jrose-apple deleted the open-stdlib branch August 1, 2016 18:01
kateinoigakukun pushed a commit that referenced this pull request Aug 31, 2022
[pull] swiftwasm from main
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