Skip to content

Implementation of the SE-130 proposal. #3758

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
Jul 27, 2016

Conversation

swiftix
Copy link
Contributor

@swiftix swiftix commented Jul 26, 2016

What's in this pull request?

Resolved bug number: (SR-1964)

rdar://problem/17028332

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.

It replaces String initializers taking Character or UnicodeScalar as a repeating value by a more general initializer that takes a String as a repeating value. This is done to avoid the ambiguities in the current String API, which can be only resolved by explicit casting.
String.append(_:UnicodeScalar) APIs is also removed to match these changes.

@swiftix
Copy link
Contributor Author

swiftix commented Jul 26, 2016

@gribozavr Please review this implementation of the SE-130 proposal.

@swiftix
Copy link
Contributor Author

swiftix commented Jul 26, 2016

@swift-ci Please test

@@ -12,7 +12,8 @@
import TestsUtils

public func run_StringWithCString(_ N: Int) {
let str = String(repeating: "x" as UnicodeScalar, count: 100 * (1 << 16))
let x = UnicodeScalar("x")
let str = String(repeating: String(x), count: 100 * (1 << 16))
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not just:

let str = String(repeating: "x", count: 100 * (1 << 16))

@swiftix
Copy link
Contributor Author

swiftix commented Jul 26, 2016

@parkera This PR implements SE-130. Among other things, it removed String(repeating:Character, count:) in favor of String(repeating: String, count:). Foundation uses the old API at two different places according to these compilation errors.

@parkera
Copy link
Contributor

parkera commented Jul 26, 2016

Those look fine to me.

It replaces String initializers taking Character or UnicodeScalar as a repeating value by a more general initializer that takes a String as a repeating value. This is done to avoid the ambiguities in the current String API, which can be only resolved by explicit casting.
String.append(_:UnicodeScalar) APIs is also removed to match these changes.
@swiftix swiftix force-pushed the SE-130-implementation branch from 5cde92d to a798852 Compare July 27, 2016 03:09
@swiftix
Copy link
Contributor Author

swiftix commented Jul 27, 2016

@swift-ci Please some test Linux

@swiftix
Copy link
Contributor Author

swiftix commented Jul 27, 2016

@swift-ci Please smoke test Linux

@swiftix
Copy link
Contributor Author

swiftix commented Jul 27, 2016

@gribozavr Do you mind having a look at it? The biggest change is the fix for "appendToSubstringBug" test failure.

@swiftix
Copy link
Contributor Author

swiftix commented Jul 27, 2016

It is impossible to test this PR and the related swiftlang/swift-package-manager#561 and swiftlang/swift-corelibs-foundation#477 using our CI. But I'm testing on a Linux box.

@swiftix
Copy link
Contributor Author

swiftix commented Jul 27, 2016

OK. All tests on the Linux box seem to pass.

I'm going to merge now.

@swiftix swiftix merged commit 9756755 into swiftlang:master Jul 27, 2016
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.

3 participants