Skip to content

[stdlib][SE-0089] Finish off Lossless String Conversion #3761

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 3 commits into from
Jul 29, 2016

Conversation

CodaFi
Copy link
Contributor

@CodaFi CodaFi commented Jul 26, 2016

What's in this pull request?

While Max is away, this patch finishes up his work on SE-0089.

Resolved bug number: (SR-1881)


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.

extension UnicodeScalar : LosslessStringConvertible {
public init?(_ description: String) {
_precondition(description.unicodeScalars.count == 1)
if let v = description.unicodeScalars.first {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This feels too clever.

@CodaFi CodaFi force-pushed the lose-less-smile-more branch 5 times, most recently from 3b38691 to 5eeddf5 Compare July 26, 2016 21:43
@CodaFi
Copy link
Contributor Author

CodaFi commented Jul 26, 2016

@swift-ci please test.

@CodaFi
Copy link
Contributor Author

CodaFi commented Jul 26, 2016

@gribozavr @dabrahams Mind a quick review?

@@ -355,7 +355,7 @@ public struct Character :

extension Character : CustomStringConvertible {
public var description: String {
return String(self)
return String(describing: self)
Copy link
Contributor

Choose a reason for hiding this comment

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

This method should not go through reflection either, there are better, more performant ways to do this. (And wouldn't it call itself in fact?)

@gribozavr
Copy link
Contributor

Reviewed.

@CodaFi CodaFi force-pushed the lose-less-smile-more branch 6 times, most recently from 5629b9a to db8be58 Compare July 27, 2016 18:36
@CodaFi
Copy link
Contributor Author

CodaFi commented Jul 27, 2016

@swift-ci please smoke test.

@CodaFi
Copy link
Contributor Author

CodaFi commented Jul 27, 2016

Patches are lined up for the other repos and tested locally - this should be ready for manual merge after we sort the bots.

@CodaFi
Copy link
Contributor Author

CodaFi commented Jul 28, 2016

@gribozavr
Copy link
Contributor

@CodaFi I merged more tests to test/1_stdlib/Test*.swift for Foundation types, that are very similar to tests that you had to adjust. Could you double-check that the new tests don't break with this PR?

@CodaFi CodaFi force-pushed the lose-less-smile-more branch from db8be58 to 7c2b328 Compare July 28, 2016 18:49
@CodaFi
Copy link
Contributor Author

CodaFi commented Jul 28, 2016

Thanks for letting me know, testing now.

@CodaFi CodaFi force-pushed the lose-less-smile-more branch from 7c2b328 to ec9998f Compare July 28, 2016 19:32
@tkremenek
Copy link
Member

@swift-ci smoke test

@CodaFi
Copy link
Contributor Author

CodaFi commented Jul 28, 2016

@tkremenek Ready to merge.

@gribozavr
Copy link
Contributor

@swift-ci Please test

@gribozavr
Copy link
Contributor

@CodaFi Seems like we need fixes for the playgrounds repo:

/Users/buildnode/jenkins/workspace/swift-PR-osx/swift-xcode-playground-support/PlaygroundLogger/PlaygroundLogger/LoggerMirror.swift:122:16: error: cannot invoke initializer for type 'String' with an argument list of type '(Any)'

@gribozavr
Copy link
Contributor

And Foundation, too:

Foundation/NSBundle.swift:66:19: error: cannot invoke initializer for type 'String' with an argument list of type '(Bundle.Type)'
        return "\(String(Bundle.self)) <\(bundleURL.path!)> (\(isLoaded  ? "loaded" : "not yet loaded"))"

@shahmishal
Copy link
Member

We are seeing following test failures in CI (Ubuntu 15.10), after merging this PR.
https://ci.swift.org/job/oss-swift-incremental-RA-linux-ubuntu-15_10/6928/console

Failing Tests (3):
    Swift(linux-x86_64) :: StdlibUnittest/RaceTest.swift
    Swift(linux-x86_64) :: stdlib/AtomicInt.swift
    Swift(linux-x86_64) :: stdlib/String.swift

@CodaFi
Copy link
Contributor Author

CodaFi commented Jul 29, 2016

So so sorry. Patch incoming.

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.

6 participants