Commit Graph

42 Commits

Author SHA1 Message Date
Dave Abrahams
a8d56c3f54 [stdlib] Shuffle methods to keep comments in sync
Swift SVN r31190
2015-08-12 21:44:09 +00:00
Dave Abrahams
880f28b3fd [stdlib] Add missing 10.10 NSString APIs.
containsString and localizedCaseInsensitiveContainsString were
introduced in 10.10, release-noted, but never
documented (<rdar://22236574>), so we missed them.

Fixes <rdar://18776075> String.containsString doesn't work in Swift

Swift SVN r31152
2015-08-12 00:37:43 +00:00
Dmitri Hrybenko
e587ef0086 SDK overlay: adopt @warn_unused_result
Swift SVN r31051
2015-08-06 15:54:52 +00:00
David Farler
8febbc1095 Suggest NSURL path methods instead of NSString
rdar://problem/22095657

Swift SVN r30978
2015-08-04 02:59:41 +00:00
David Farler
1f2390f1c7 Drop APIs from NSPathUtilities.h on String
rdar://problem/18848175

Swift SVN r30507
2015-07-22 22:12:56 +00:00
Joe Groff
d6f1178568 Foundation overlay: Deprecate String "PercentEscapesUsingEncoding" methods.
These have been superseded by newer APIs in Foundation, and Swift should follow suit. rdar://problem/21397308

Swift SVN r30356
2015-07-18 02:25:51 +00:00
Dmitri Hrybenko
687a70428d Fix a warning in the SDK overlay
This change was committed and reverted multiple times over the past
month, but now it is safe since we have bumped the minimum required
SDKs.

Swift SVN r29269
2015-06-03 03:17:30 +00:00
Dmitri Hrybenko
1058f68bc6 Foundation overlay: add overlays for new NSString APIs
rdar://20856757

Swift SVN r29019
2015-05-26 03:29:01 +00:00
Ted Kremenek
a2c4ea971f Revert "Foundation overlay: add overlays for new NSString APIs"
Revert until our Jenkins devices support the underlying NSString API.  Keeping
this blocks iOS testing.

Swift SVN r28987
2015-05-24 16:55:25 +00:00
Dmitri Hrybenko
d45413efb8 Foundation overlay: add overlays for new NSString APIs
Swift SVN r28984
2015-05-24 10:39:21 +00:00
Joe Groff
32fb006386 Clang Importer: Enable OptionSetType import.
Update the tests to match.

Swift SVN r28906
2015-05-22 05:47:37 +00:00
Dmitri Hrybenko
53f3ccf850 stdlib: change CollectionType.count() into a property
Swift SVN r28829
2015-05-20 09:14:43 +00:00
Ted Kremenek
62feb5c949 Change @availability to @available.
This came out of today's language review meeting.
The intent is to match #available with the attribute
that describes availability.

This is a divergence from Objective-C.

Swift SVN r28484
2015-05-12 20:06:13 +00:00
Dave Abrahams
5c55682d8b [stdlib] Capitalize keywords in doc comments
Again, the text is a lot more readable that way.

Swift SVN r28472
2015-05-12 16:59:13 +00:00
Dmitri Hrybenko
61214ec55b stdlib: remove Sliceable conformance from String
Swift SVN r28442
2015-05-11 20:58:31 +00:00
Chris Lattner
c1df892d47 improve stdlib hygiene a bit.
Swift SVN r28392
2015-05-10 02:55:18 +00:00
Dmitri Hrybenko
e24c262d6e Foundation overlay: add String.stringByApplyingTransform()
This API is new in OS X 10.11 and iOS 9.0.

rdar://20645458

Swift SVN r28315
2015-05-08 08:36:44 +00:00
Dmitri Hrybenko
8b392eeea9 Revert "Remove Array.count, it is redundant with protocol extensions"
This reverts commit r28247 while we discuss the change.

Swift SVN r28292
2015-05-07 21:45:30 +00:00
Ted Kremenek
7a96e55cde Revert "Foundation overlay: add String.stringByApplyingTransform()"
Speculatively reverted because of iOS bot failure.

Swift SVN r28261
2015-05-07 14:00:16 +00:00
Dmitri Hrybenko
15a558f919 Foundation overlay: add String.stringByApplyingTransform()
This API is new in OS X 10.11 and iOS 9.0.

rdar://20645458

Swift SVN r28257
2015-05-07 06:54:15 +00:00
Dmitri Hrybenko
58601fafc8 Remove Array.count, it is redundant with protocol extensions
Swift SVN r28247
2015-05-07 00:30:41 +00:00
Dmitri Hrybenko
c109ec9125 stdlib: protocol extensions: de-underscore count()
Swift SVN r28246
2015-05-07 00:30:38 +00:00
Dmitri Hrybenko
e253881b02 stdlib: protocol extensions: de-underscore indices
Swift SVN r28245
2015-05-07 00:30:35 +00:00
Dave Abrahams
04d6928390 [stdlib] Pinging the compiler doesn't usually help
Swift SVN r28225
2015-05-06 23:06:58 +00:00
Chris Lattner
37f5452d15 require -> guard.
Swift SVN r28223
2015-05-06 22:53:38 +00:00
Ted Kremenek
92e6051cce Revert "[stdlib] NSStringAPI: add stringByApplyingTransform"
Right now this is breaking our iOS bots.  Let's temporarily revert while we investigate.

Swift SVN r28201
2015-05-06 15:58:05 +00:00
Dave Abrahams
a3270c105c [stdlib] NSStringAPI: add stringByApplyingTransform
Swift SVN r28171
2015-05-05 17:35:43 +00:00
Ted Kremenek
bde7daa23d Revert "[stdlib] NSStringAPI: add stringByApplyingTransform"
This is breaking NSStringAPI.swift on the bots.

Swift SVN r28084
2015-05-02 07:16:48 +00:00
Dave Abrahams
af07713820 [stdlib] NSStringAPI: add stringByApplyingTransform
Swift SVN r28082
2015-05-02 05:52:28 +00:00
John McCall
ac50cbc801 Enable error-handling in import by default.
Swift SVN r28048
2015-05-01 20:35:28 +00:00
Chris Lattner
31c01eab73 Change the meaning of "if let x = foo()" back to Xcode 6.4 semantics. The compiler
includes a number of QoI things to help people write the correct code.  I will commit
the testcase for it as the next patch.

The bulk of this patch is moving the stdlib, testsuite and validation testsuite to
the new syntax.  I moved a few uses of "as" patterns back to as? expressions in the 
stdlib as well.



Swift SVN r27959
2015-04-30 04:38:13 +00:00
Dmitri Hrybenko
5ae502d1f5 Revert "NSStringAPI: Remove useless forced cast"
This reverts commit r27809.  We're still building with SDKs that
requires the cast.

Swift SVN r27815
2015-04-27 19:39:33 +00:00
Slava Pestov
0de6e67a2f NSStringAPI: Remove useless forced cast
Swift SVN r27809
2015-04-27 18:55:49 +00:00
David Farler
9e28dc777a Update standard library doc comments to Markdown
rdar://problem/20180478

Swift SVN r27726
2015-04-26 00:07:11 +00:00
Doug Gregor
793b3326af Implement the new rules for argument label defaults.
The rule changes are as follows:
  * All functions (introduced with the 'func' keyword) have argument
  labels for arguments beyond the first, by default. Methods are no
  longer special in this regard.
  * The presence of a default argument no longer implies an argument
  label.

The actual changes to the parser and printer are fairly simple; the
rest of the noise is updating the standard library, overlays, tests,
etc.

With the standard library, this change is intended to be API neutral:
I've added/removed #'s and _'s as appropriate to keep the user
interface the same. If we want to separately consider using argument
labels for more free functions now that the defaults in the language
have shifted, we can tackle that separately.

Fixes rdar://problem/17218256.

Swift SVN r27704
2015-04-24 19:03:30 +00:00
Dmitri Hrybenko
971598e430 Revert "stdlib: fix a warning"
This reverts commit r27570.  The SDK on buildbots is too old.

Swift SVN r27572
2015-04-22 07:17:56 +00:00
Dmitri Hrybenko
76b330519d stdlib: fix a warning
Swift SVN r27570
2015-04-22 07:06:40 +00:00
Dmitri Hrybenko
ff2dd6320a stdlib: fix coding style
When colon specifies is-a relationship between types, we put spaces on
both sides of the colon.

Swift SVN r27016
2015-04-05 05:54:55 +00:00
Dmitri Hrybenko
ab408d4dc3 Update the compiler and SDK overlay for nullability and generics in Foundation
We have an SPI between the Swift compiler and Foundation based on the
SWIFT_SDK_OVERLAY_FOUNDATION_EPOCH preprocessor macro that allows us to
request the new API.  rdar://20270080 tracks removing it.

Swift SVN r26475
2015-03-24 02:18:06 +00:00
Dmitri Hrybenko
6278badc4f Foundation overlay: use the current locale in String(localizedStringWithFormat:)
No test since a proper test requires method swizzling and that would
take a while to write.  Tested manually.

rdar://20171815

Swift SVN r26343
2015-03-20 01:17:44 +00:00
Chris Lattner
20f8f09ea8 Land: <rdar://problem/19382905> improve 'if let' to support refutable patterns and untie it from optionals
This changes 'if let' conditions to take general refutable patterns, instead of
taking a irrefutable pattern and implicitly matching against an optional.

Where before you might have written:
  if let x = foo() {

you now need to write:
  if let x? = foo() {
    
The upshot of this is that you can write anything in an 'if let' that you can
write in a 'case let' in a switch statement, which is pretty general.

To aid with migration, this special cases certain really common patterns like
the above (and any other irrefutable cases, like "if let (a,b) = foo()", and
tells you where to insert the ?.  It also special cases type annotations like
"if let x : AnyObject = " since they are no longer allowed.

For transitional purposes, I have intentionally downgraded the most common
diagnostic into a warning instead of an error.  This means that you'll get:

t.swift:26:10: warning: condition requires a refutable pattern match; did you mean to match an optional?
if let a = f() {
       ^
        ?

I think this is important to stage in, because this is a pretty significant
source breaking change and not everyone internally may want to deal with it
at the same time.  I filed 20166013 to remember to upgrade this to an error.

In addition to being a nice user feature, this is a nice cleanup of the guts
of the compiler, since it eliminates the "isConditional()" bit from
PatternBindingDecl, along with the special case logic in the compiler to handle
it (which variously added and removed Optional around these things).




Swift SVN r26150
2015-03-15 07:06:22 +00:00
Dmitri Hrybenko
350248dae5 Reorganize the directory structure under 'stdlib'
The standard library has grown significantly, and we need a new
directory structure that clearly reflects the role of the APIs, and
allows future growth.

See stdlib/{public,internal,private}/README.txt for more information.

Swift SVN r25876
2015-03-09 05:26:05 +00:00