Commit Graph

75 Commits

Author SHA1 Message Date
Max Moiseev
b49adc2398 Update UIKit
Changes simlar to those in AppKit.

<rdar://problem/34131288>
2017-11-06 15:52:52 -08:00
Max Moiseev
e43f146c5b [overlay] Replace _SwiftDragDropItemProvider with _ObjectiveCBridgeable 2017-07-14 22:47:17 -07:00
Dave Rahardja
1382fc85d7 [overlay] Add NSItemProviderReading/Writing methods to UIKit overlay
<rdar://problem/32138581>
2017-07-14 17:15:58 -07:00
Max Moiseev
391d49a31e [overlay] Hide the _ExpressibleByColorLiteral initializer from code completion.
Fixes: <rdar://problem/32726800>
2017-07-12 09:05:06 -07:00
Max Moiseev
52522f118c [overlay] Implement UIFocusEnvironment.contains using a shim
Addresses: <rdar://problem/32538412>
2017-06-20 17:14:24 -07:00
Mishal Shah
c5ff1f2cac Update master to build with Xcode 9 beta 1, OS X 10.13, iOS 11, tvOS 11, and watchOS 4 SDKs. 2017-06-14 16:20:35 -07:00
practicalswift
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01:00
JP Simard
7301b79342 remove superfluous parentheses in control statements in stdlib source
since this appears to be the convention followed elsewhere in the code base.
2016-12-31 18:40:15 -08:00
practicalswift
797b80765f [gardening] Use the correct base URL (https://swift.org) in references to the Swift website
Remove all references to the old non-TLS enabled base URL (http://swift.org)
2016-11-20 17:36:03 +01:00
Robert Widmann
f97e5dcb0e [SE-0115][1/2] Rename *LiteralConvertible protocols to ExpressibleBy*Literal. This
change includes both the necessary protocol updates and the deprecation
warnings
suitable for migration.  A future patch will remove the renamings and
make this
a hard error.
2016-07-12 15:25:24 -07:00
Dmitri Gribenko
d591f9cf7a stdlib: remove most uses of @warn_unused_result, which does nothing now
I kept the one on sorted(), because that one requires a less trivial
change.
2016-05-19 18:39:39 -07:00
John McCall
a1c1693529 Change the names of the object-literal initializers to be
semantically unambiguous.

We didn't actually intend to change how programmers normally
constructed these types, but the change to the object literal
syntax accidentally caused these initializers to have very
natural-seeming signatures.  These initializers also created
possible ambiguities with the actual initializers.  Renaming
them to refer to their function as literal initializers is the
right thing to do.

Unfortunately, this provided to be somewhat annoying, as the
code was written to assume that the argument tuple following
e.g. #colorLiteral could be directly passed to the initializer.
We solve this by hacking on both ends of the constraint system:
during generation we form a conversion constraint to the
original, idealized parameter type, and during application we
rewrite the argument tuple type to use the actual labels.
This nicely limits the additional complexity to just the
parts dealing with object literals.

Note that we can't just implicitly rewrite the tuple expression
because that would break invariants tying the labels to physical
source ranges.  We also don't want to just change the literal
syntax again and break compatibility with existing uses.

rdar://26148507
2016-05-13 10:33:37 -07:00
Max Moiseev
5345128c74 [stdlib] workaround for CustomPlaygroundQuickLookable in UIView subclasses 2016-05-09 17:07:15 -07:00
Ted Kremenek
b8bbed8c13 [WIP] Implement SE-0039 (Modernizing Playground Literals) (#2215)
* Implement the majority of parsing support for SE-0039.

* Parse old object literals names using new syntax and provide FixIt.

For example, parse "#Image(imageLiteral:...)" and provide a FixIt to
change it to "#imageLiteral(resourceName:...)".  Now we see something like:

test.swift:4:9: error: '#Image' has been renamed to '#imageLiteral
var y = #Image(imageLiteral: "image.jpg")
        ^~~~~~ ~~~~~~~~~~~~
        #imageLiteral resourceName

Handling the old syntax, and providing a FixIt for that, will be handled in a separate
commit.

Needs tests.  Will be provided in later commit once full parsing support is done.

* Add back pieces of syntax map for object literals.

* Add parsing support for old object literal syntax.

... and provide fixits to new syntax.

Full tests to come in later commit.

* Improve parsing of invalid object literals with old syntax.

* Do not include bracket in code completion results.

* Remove defunct code in SyntaxModel.

* Add tests for migration fixits.

* Add literals to code completion overload tests.

@akyrtzi told me this should be fine.

* Clean up response tests not to include full paths.

* Further adjust offsets.

* Mark initializer for _ColorLiteralConvertible in UIKit as @nonobjc.

* Put attribute in the correct place.
2016-04-25 07:19:26 -07:00
Ted Kremenek
8e91efb39d Revert "Revert "[Import as member] First draft of renaming CG APIs"" 2016-04-08 21:26:03 -07:00
Ted Kremenek
18504de7dd Revert "[Import as member] First draft of renaming CG APIs" 2016-04-08 21:00:00 -07:00
Michael Ilseman
3a2fed44f5 [Import as member] First draft of renaming CG APIs
This includes several large manual renaming of CG APIs where we want
different results than what the inference system produces.
2016-04-08 15:27:59 -07:00
Manav Gabhawala
7928140f79 [SE-0046] Implements consistent function parameter labels by discarding extraneous parameter names and adding _ where necessary 2016-04-06 20:21:58 -04:00
Michael Ilseman
c5dc3469de [Import as member] Fix UIKit overlay for Playground quicklook 2016-04-06 11:03:18 -07:00
Jordan Rose
d9596ab1dd Merge pull request #1323 from neilkimmett/master
Add .zero convenience static vars for UIEdgeInsets and UIOffset

Discussed with UIKit in rdar://problem/24678068.
2016-03-25 16:55:42 -07:00
Dmitri Gribenko
00c5d6368e Port iOS and watchOS SDK overlays to the latest Clang importer rules 2016-03-09 18:58:13 -08:00
Mishal Awadah
ad2a309ee2 Revert "Revert "[stdlib] Fix API renaming build failures""
This reverts commit 7e7da9eda5.

The original commit has been reviewed.
2016-02-23 10:37:14 -08:00
mawadah
7e7da9eda5 Revert "[stdlib] Fix API renaming build failures"
Instead, using a PR to merge.

This reverts commit 9bf2a86cf8.
2016-02-23 08:24:47 -08:00
mawadah
9bf2a86cf8 [stdlib] Fix API renaming build failures 2016-02-23 08:23:06 -08:00
Neil Kimmett
c4d5ccb5bd Add .zero convenience static vars for UIEdgeInsets and UIOffset
Using UIEdgeInsetsZero instead of UIEdgeInsets.zero was annoying.
Copied the style from '/stdlib/public/SDK/CoreGraphics/CoreGraphics.swift'
2016-02-16 14:34:15 +00:00
Max Moiseev
61c837209b Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-02-04 16:13:39 -08:00
Austin Zheng
77918a86ac [SR-88] Reinstate Mirror migration changes, fix test issues
This reverts commit 182bb7f812.
2016-01-27 20:40:52 -08:00
Andrew Trick
182bb7f812 Revert "Merge pull request #1058 from austinzheng/az-port-mirror"
This pull request broke the following tests on several build configurations
(eg --preset=buildbot,tools=RA,stdlib=DA)

    1_stdlib/Reflection.swift
    1_stdlib/ReflectionHashing.swift
    1_stdlib/UnsafePointer.swift.gyb

This reverts commit c223a3bf06, reversing
changes made to 5c2bb09b09.
2016-01-27 10:43:08 -08:00
Austin Zheng
10d5b23c30 [SR-88] Reinstate mirror migration commit
Changes:
- Reverted commit reverting original SR-88 commit
- Removed mirror children helper collections and related code
- Rewrote some tests to keep them working properly
- Wrote two more tests for the three pointer APIs to ensure no crashes if created using a value > Int64.max

This reverts commit 8917eb0e5a.
2016-01-26 19:28:32 -08:00
Mark Lacey
8917eb0e5a Revert "[Runtime][StdLib] Migrate mirrors to use CustomReflectable API, rewrite dump()"
This reverts commit 9798dfd4aa because it
broke the stdlib build.
2016-01-22 08:41:07 -08:00
Austin Zheng
9798dfd4aa [Runtime][StdLib] Migrate mirrors to use CustomReflectable API, rewrite dump()
Jira: SR-88
Changes:
- Removed stdlib type conformances to _Reflectable
- Conformed stdlib types to CustomReflectable, CustomPlaygroundQuickLookable
- Rewrote dump() function to not use _reflect()
- CGRect, CGPoint, CGSize now conform to CustomDebugStringConvertible
- Rewrote unit tests for compatibility with new API
2016-01-21 09:44:15 -08:00
Max Moiseev
f51e708a8f Merge remote-tracking branch 'origin/master' into swift-3-api-guidelines 2016-01-04 12:25:25 -08:00
Zach Panzarino
e3a4147ac9 Update copyright date 2015-12-31 23:28:40 +00:00
semper_idem
6aa415f8a7 [stdlib] indentation fix
[stdlib] indentation fix
2015-12-25 17:19:49 +08:00
semper_idem
c8dd8ab73f [stdlib]Replace NSMutableSet with Set
1. I think replace the NSMutableSet with Set<UIView>(and Set<NSView>)
could make the operations more Swift-like.

These code works fine in my Playground, and I also pass the test. But
I’m not quite sure it’s ok to use Set here rather than NSSet.

2. I also simplify the read-only computed property in “UIKit.swift”
2015-12-25 17:06:48 +08:00
Doug Gregor
2091e7f852 Merge remote-tracking branch 'origin/swift-3-api-guidelines' into swift-3-omit-needless-words 2015-12-18 10:54:46 -08:00
Dmitri Gribenko
73ce9ae7e9 Collection.count => .length
And other API changes that naturally fall out from this, like
Array(repeating:count:) => Array(repeating:length:).
2015-12-17 15:55:29 -08:00
Doug Gregor
f245f18a09 Merge remote-tracking branch 'origin/swift-3-api-guidelines' into swift-3-omit-needless-words 2015-12-17 11:35:58 -08:00
Maxim Moiseev
e6468a0eca _precondition => _require 2015-12-16 17:19:01 -08:00
Maxim Moiseev
0e54467bfa Final bulk removal of Type suffix 2015-12-16 17:06:19 -08:00
Doug Gregor
06c5e9cd5b Enable "omit needless words" by default.
Most of this is in updating the standard library, SDK overlays, and
piles of test cases to use the new names. No surprises here, although
this shows us some potential heuristic tweaks.

There is one substantive compiler change that needs to be factored out
involving synthesizing calls to copyWithZone()/copy(zone:). Aside from
that, there are four failing tests:

    Swift :: ClangModules/objc_parse.swift
    Swift :: Interpreter/SDK/Foundation_test.swift
    Swift :: Interpreter/SDK/archiving_generic_swift_class.swift
    Swift :: Interpreter/SDK/objc_currying.swift

due to two independent remaining compiler bugs:
  * We're not getting partial ordering between NSCoder's
  encode(AnyObject, forKey: String) and NSKeyedArchiver's version of
  that method, and
  * Dynamic lookup (into AnyObject) doesn't know how to find the new
  names. We need the Swift name lookup tables enabled to address this.
2015-12-11 14:46:50 -08:00
ken0nek
2218e433b4 Add whitespaces after comma and remove redundant whitespaces.
Manage whitespaces

Remove unrelated line

Fix

Fix again
2015-12-04 15:36:34 +09:00
Jordan Rose
cf8baedee2 Re-apply "Rename @transparent to @_transparent for now."
This re-applies 90fcbfe9a6. I'll be committing
the corresponding change to Foundation momentarily.
2015-11-16 10:53:56 -08:00
Xin Tong
16843684b2 Revert "Rename @transparent to @_transparent for now."
This reverts commit 90fcbfe9a6.

Seems there are still some tests that are left not modified.
2015-11-14 07:04:31 -08:00
Jordan Rose
90fcbfe9a6 Rename @transparent to @_transparent for now.
This feature has not been fully designed, let alone properly implemented.
For more information, see docs/TransparentAttr.rst.
2015-11-13 16:25:34 -08:00
Jordan Rose
6e1bf0d10d Rename @exported to @_exported for now.
At some point I want to propose a revised model for exports, but for now
just mark that support for '@exported' is still experimental and subject
to change. (Thanks, Max.)
2015-11-05 11:59:00 -08:00
Dmitri Hrybenko
2e51d23875 Un-ifdef object literals
Swift SVN r32880
2015-10-25 07:50:53 +00:00
David Farler
9e4d52c9cb Reinstate watchOS and other SDK overlays to build against the public SDKs.
Un-revert the below commits with the following addition:
add declarations for posix_spawn related APIs to SwiftPrivateDarwinExtras.
posix_spawn-related APIs aren't available in the public SDKs, so force past
the availability by creating our own stubs in the internal DarwinExtras
library.

r31244, r31245

CMake: build all platforms except watchOS using the public SDK

Covers rdar://problem/21145996.
A step towards rdar://problem/21099318.

Switch SDK overlays to use the public SDK

I had to cut the dependency on CrashReporterClient.h and reimplement
some of that code inline in the Swift runtime.  This shoud be OK (even
though not very clean), since the layout of CrashReporter sections is
ABI.

rdar://21099318

Swift SVN r31252
2015-08-14 22:09:49 +00:00
Dmitri Hrybenko
c75fc00cec Revert "CMake: build all platforms except watchOS using the public SDK"
This reverts commit r31244.  It broke the buildbot.

Swift SVN r31247
2015-08-14 18:56:15 +00:00
Dmitri Hrybenko
dd38372fb7 CMake: build all platforms except watchOS using the public SDK
Covers rdar://problem/21145996.
A step towards rdar://problem/21099318.

Swift SVN r31244
2015-08-14 17:26:04 +00:00