Commit Graph

1358 Commits

Author SHA1 Message Date
Arnold Schwaighofer
e4ece365b9 Annotate bridgeTo/FromObjectiveC in Foundation.swift
This will allow us to recognize identity compositions.

 (bridge_from (bridge_to x)) -> x
 (bridge_to (bridge_from x)) -> x

rdar://19178324

Swift SVN r26240
2015-03-17 23:27:19 +00:00
Enrico Granata
b9f0a6d22b This is the equivalent of r24737 for iOS
"Only remove the view from the set of views that are being Mirror-drawn when you're actually done reflecting on it  The previous code would always remove the view on exit, even if it had not previously added it (default: case of the switch)  In simple cases, this didn't really matter, but if you caused the logger to be reinvoked on self in a loop, then you would end up removing the view before you were done looping over it, and eventually run out of stack space"

In this case, it fixes rdar://20193122



Swift SVN r26235
2015-03-17 21:15:48 +00:00
Dmitri Hrybenko
e6f53a38cc stdlib: remove swift_createDate
It was added for testing and it is actually never used now.

Swift SVN r26195
2015-03-16 22:25:27 +00:00
Chris Lattner
7b13a367a7 clean up some uses of typed patterns in nested contexts. The only reason anyone was using
them was because of the obsolete AnyObject warning.


Swift SVN r26159
2015-03-15 18:26:24 +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
Doug Gregor
c69294562e Clean up explicit protocol conformances in the standard library.
Eliminates redundant conformances and resolves ambiguous implied
conformances. NFC.

Swift SVN r26066
2015-03-12 21:11:12 +00:00
Dmitri Hrybenko
cf9635828a Update the overlay for iOS SDK changes: CIFilter.init() is now failable
Swift SVN r25893
2015-03-09 21:00:15 +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