Commit Graph

1102 Commits

Author SHA1 Message Date
practicalswift
64b3c6c880 [gardening] Remove invisible ^H 2016-06-15 22:54:11 +02:00
practicalswift
223d8d63f7 [gardening] Use "\"" instead of "“" or "”". 2016-06-15 22:54:11 +02:00
practicalswift
dcab7e726f [gardening] Use "*" instead of "•" 2016-06-15 22:44:23 +02:00
practicalswift
cc47c70019 [gardening] Use "'" instead of "’". 2016-06-15 22:43:25 +02:00
Doug Gregor
eadc7aa727 Merge two SWIFT_MODULE_DEPENDS_OSX into one
This re-establishes MultipeerConnectivity -> AppKit dependency.
2016-06-14 18:11:56 -07:00
Mishal Shah
87b7bcfd3e Update master to build with Xcode 8 beta 1, OS X 10.12, iOS 10, tvOS 10, and watchOS 3 SDKs. 2016-06-14 14:53:55 -07:00
Doug Gregor
7b226ad177 [Omit Needless Words] Don't remove a first argument label when the parameter has as default argument.
Parameters that have default arguments should have argument labels;
don't remove them on import. Fixes rdar://problem/26611977.
2016-06-13 11:58:41 -07:00
Doug Gregor
2807a17eb8 [Type checker SR-899] Warning on missing ".self" for single-parameter functions.
Due to a modeling error in the type checker's folding of type
references into type expressions, code such as "strideof(Int)" would
be accepted without the required ".self". Commit
4a60b6cbf4 fixes the modeling issue but
left the historical accepts-invalid; now, diagnose these cases with a
warning + Fix-It to ease the transition.

Fixes SR-899.
2016-06-12 22:31:59 -07:00
Brian Gesiak
fd136cc28c Merge pull request #2788 from briancroom/pr-2551
SR-1417: Add non-optional overloads of XCTAssertEqual and XCTAssertNotEqual
2016-06-08 14:41:11 -04:00
practicalswift
57bccc8b06 [gardening] Fix inconsistent formatting. 2016-06-04 00:37:15 +02:00
Dmitri Gribenko
974fe589fe Merge pull request #2806 from rintaro/se-0081-stdlib-migration
[SE-0081][stdlib] Apply tail style "where" clause to stdlib
2016-06-02 02:07:55 -07:00
rintaro ishizaki
d3b9d470be [Foundation] Apply tail style "where" clause to Foundation SDK overlay 2016-06-02 12:04:42 +09:00
Dmitri Gribenko
3661c398ba SDK overlay: add ABI FIXME 2016-06-01 11:05:07 -07:00
Nicola Salmoria
956b6b1cad SR-1417: Add non-optional overloads of XCTAssertEqual and XCTAssertNotEqual
Previously, the only version of the functions that accepted values was the one that implicitly wraps them into Optionals. This generated a confusing error message when the assert failed. Having a separate overload that accepts non-optional types ensures that the correct description is printed when the assert fails.
2016-05-31 08:16:02 -04: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
Roman Levenstein
0c1c5d6086 Revert "Add a missing SceneKit dependency to WatchKit"
This reverts commit 6ef2f82225.
It was a wrong fix for the build failures.
2016-05-18 17:16:22 -07:00
Roman Levenstein
6ef2f82225 Add a missing SceneKit dependency to WatchKit 2016-05-18 17:08:55 -07:00
swift-ci
4b232fa335 Merge pull request #2581 from apple/stdlib-remove-deprecated-floating-point-apis 2016-05-18 12:22:14 -07:00
Dmitri Gribenko
314dfe0ab3 stdlib: remove deprecated floating point APIs 2016-05-17 23:41:51 -07:00
Dmitri Gribenko
a86a7f7608 stdlib: remove unused floating point APIs in floating point 2016-05-17 18:44:58 -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
Trent Nadeau
6e327b4ddb Updated stdlib to use @discardableResult and _ = . 2016-05-11 22:53:37 -04:00
Stephen Canon
772d7ec3c5 Merge branch 'SE-0067' of https://github.com/stephentyrone/swift into stephentyrone-SE-0067
Implements almost all of SE-0067. There are a few outstanding features; this implementation does not have:

- formRemainder(dividingBy:)
- formSquareRoot()
- addProduct(_:,_:)

which require additions to the Builtin module. I can probably figure out how to do these, but I haven't had a chance to do so yet. Also missing are the generic initializers and comparisons whose implementation depends on having new Integer protocols.

The last remaining feature of SE-0067 is that while the basic operators +,-,*,/, etc are moved onto the FloatingPoint protocol, they are still required on the concrete types in order to disambiguate overloads. Fixing this seems to require either modifying the overload resolution rules or removing these operators from some other protocols. Or it might just require that someone smarter than me looks at the problem.

Passes the existing tests locally (with the included changes). I'm working on additional tests for the new features.
2016-05-11 22:11:21 -04:00
Dmitri Gribenko
0556c4b387 Merge pull request #2480 from compnerd/attribute-spelling
stdlib: use the reserved attribute spellings
2016-05-11 16:28:17 -07:00
Dmitri Gribenko
ff49e17eb2 Remove dead code 2016-05-11 11:47:03 -07:00
Dmitri Gribenko
94f49d443d CGFloat: add CGFloat.init(CGFloat), which makes CGFloat similar to Float and Double
This is an API bugfix, this API was accidentally omitted when we added
CGFloat to the overlay, so no evolution proposal is necessary.
2016-05-11 11:45:58 -07:00
Saleem Abdulrasool
81661fca61 stdlib: use the reserved attribute spellings
This is a purely mechanical change replacing the attributes with the reserved
spelling.  Compilers are to not error when they encounter a reserved spelling
for an attribute which they do not support.
2016-05-11 11:30:24 -07:00
Ted Kremenek
60ba4325bd Further simplify SceneKit overlay by adding private extension to CGFloat. 2016-05-11 11:30:01 -07:00
Dmitri Gribenko
92289bf3a0 SceneKit overlay: simplify code 2016-05-11 01:05:35 -07:00
Dmitri Gribenko
e498a9817b SDK overlay: remove Contacts dependency from UIKit
The SDK headers don't have this dependency.  Looks like it was added by
mistake.

rdar://problem/26190517
2016-05-10 10:36:29 -07:00
Stephen Canon
63759a4a9e Remove comparison operators from concrete types, since they're now provided by FloatingPoint. 2016-05-09 21:16:55 -04:00
Max Moiseev
5345128c74 [stdlib] workaround for CustomPlaygroundQuickLookable in UIView subclasses 2016-05-09 17:07:15 -07:00
Stephen Canon
6802c5e263 Restore public on top-level operators, mark -- and ++ unavailable for CGFloat. 2016-05-09 18:35:52 -04:00
Stephen Canon
3609b690c0 Restore _to/_fromBitPattern for compatability, but mark deprecated. 2016-05-09 12:44:35 -04:00
Stephen Canon
6429eabf74 Implement the new FloatingPoint protocols from SE-0067.
There are a couple of features that are not yet implemented, because they require additions to the Builtin module.  Specifically, this implementation does not have:

- formRemainder(dividingBy:)
- formSquareRoot()
- addProduct(_:,_:)

Also missing are the generic initializers and comparisons whose implementation depends on having new Integer protocols.

The last remaining feature of SE-0067 is that while the basic operators +,-,*,/, etc are moved onto the FloatingPoint protocol, they are still required on the concrete types in order to disambiguate overloads.  Fixing this seems to require either modifying the overload resolution rules or removing these operators from some other protocols.  Or it might just require that someone smarter than me looks at the problem.

Passes all the existing tests (with the included changes).  I'm working on additional tests for the new features.
2016-05-09 10:34:13 -04:00
Ted Kremenek
d3c41c4668 Revert "Revert "SE-0072: Fully eliminate implicit bridging conversions from Swift"" (#2441) 2016-05-06 23:26:45 -07:00
Ted Kremenek
4df003c291 Revert "SE-0072: Fully eliminate implicit bridging conversions from Swift" (#2440) 2016-05-06 23:22:56 -07:00
Joe Pamer
6af546e89e Merge pull request #2419 from apple/se-0072
SE-0072: Fully eliminate implicit bridging conversions from Swift
2016-05-06 22:14:13 -07:00
Joe Pamer
3b4d98445e SE-0072: Fully eliminate implicit bridging conversions from Swift
Per Swift Evolution proposal SE-0072, these changes prevent the compiler from introducing implicit bridging conversions during type checking.
2016-05-05 19:36:33 -07:00
Jordan Rose
eec90a0496 [SDK overlay] GameplayKit depends on GLKit 2016-05-05 13:40:13 -07:00
Timothy J. Wood
0dbeca7728 [stdlib] SE-0061: Add Generic Result and Error Handling to autoreleas… (#2384)
* [stdlib] SE-0061: Add Generic Result and Error Handling to autoreleasepool()

Added `rethrows` and generic return type to ObjectiveC.autoreleasepool.
Added tests of these new capabilities.

Fixes SR-1394 and SR-842

* Updated for code style review.
2016-05-04 23:27:38 -07:00
John McCall
50d58b2732 Add a lot of calling-convention annotations to the standard library / runtime.
The general rule here is that something needs to be SWIFT_CC(swift)
if it's just declared in Swift code using _silgen_name, as opposed to
importing something via a header.

Of course, SWIFT_CC(swift) expands to nothing by default for now, and
I haven't made an effort yet to add the indirect-result / context
parameter ABI attributes.  This is just a best-effort first pass.

I also took the opportunity to shift a few files to just implement
their shims header and to demote a few things to be private stdlib
interfaces.
2016-05-04 10:31:23 -07:00
Chris Willmore
af0c7bd620 Initial implementation of SE-0054 "Abolish IUO Type" (#2322)
This is a squash of the following commits:

* [SE-0054] Import function pointer arg, return types, typedefs as optional

IUOs are only allowed on function decl arguments and return types, so
don't import typedefs or function pointer args or return types as IUO.

* [SE-0054] Only allow IUOs in function arg and result type.

When validating a TypeRepr, raise a diagnostic if an IUO is found
anywhere other thn the top level or as a function parameter or return
tpye.

* [SE-0054] Disable inference of IUOs by default

When considering a constraint of the form '$T1 is convertible to T!',
generate potential bindings 'T' and 'T?' for $T1, but not 'T!'. This
prevents variables without explicit type information from ending up with
IUO type. It also prevents implicit instantiation of functions and types
with IUO type arguments.

* [SE-0054] Remove the -disable-infer-iuos flag.

* Add nonnull annotations to ObjectiveCTests.h in benchmark suite.
2016-05-03 14:06:19 -07:00
Dave Abrahams
0d68b3a4af [stdlib] Generate RandomAccessCollection defaults
The defaults we were generating for Collection and
BidirectionalCollection didn't make any sense, because if you could do
that strideable arithmetic then you essentially had random access.
Instead we constrain the defaults to apply to RandomAccessCollection
where the Indices are a CountableRange.
2016-05-02 11:35:32 -07:00
Dmitri Gribenko
065af62293 CoreAudio overlay: remove a FIXME that is fixed 2016-05-02 11:08:57 -07:00
Jordan Rose
d7b3b6a462 Validate the "renamed" argument to @available.
It should have the same form as the argument to NS_SWIFT_NAME
in Objective-C, except that it permits operators and (currently)
disallows instance members and properties. We do get to share the
same parsing code, at least.

This actually caught an error in the Foundation overlay!

Groundwork for SR-1008.
2016-04-28 20:21:30 -07:00
Dmitri Gribenko
42d9c81919 stdlib: SE-0065: make UnsafeMutableAudioBufferListPointer a random-access collection again 2016-04-28 17:13:55 -07:00
Dave Abrahams
debde16e2c Merge set-api branch into swift-3-indexing-model 2016-04-26 15:56:42 -07:00
Dmitri Gribenko
b75d2b9df4 Merge remote-tracking branch 'origin/master' into swift-3-indexing-model 2016-04-25 13:50:09 -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