Commit Graph

1419 Commits

Author SHA1 Message Date
Max Moiseev
b5ab7263c1 Merge remote-tracking branch 'origin/master' into new-integer-protocols 2017-01-23 11:00:33 -08:00
Max Moiseev
1265f0792a Implementing arithmetic operators on NSDecimal, CGFloat, and concrete FP types 2017-01-23 10:59:24 -08:00
practicalswift
a9d6d8938c [gardening] Fix recently introduced typos 2017-01-22 20:40:45 +01:00
Maxim Moiseev
89840c738a [dispatch] Fix + and - operations on DispatchTime and DispatchWallTime (#6961)
... for the cases where `seconds` parameter is NaN or infinite.
Fixes <rdar://problem/29764171>
2017-01-20 21:44:47 -08:00
NachoSoto
a12e739fb8 Fix the fixits for dispatch_async and dispatch_group_async
They erroneously suggested `DispatchQueue.asynchronously`, but it's actually `DispatchQueue.async`.
2017-01-20 15:05:15 -08:00
Max Moiseev
d128ed42b0 Merge remote-tracking branch 'origin/master' into new-integer-protocols 2017-01-19 14:16:32 -08:00
Slava Pestov
5accebf556 Merge pull request #5344 from karwa/clearspecific
[Overlay/Dispatch]: Change DispatchQueue.setSpecific to take an optional
2017-01-18 15:59:45 -08:00
swift-ci
1b75481ab8 Merge pull request #6802 from moiseev/no-pi-warning 2017-01-17 12:23:48 -08:00
Max Moiseev
b2efca54d6 Removing unnecessary CGFloat->Double->CGFloat conversions 2017-01-17 11:29:50 -08:00
Kevin Ballard
aa0cfa33af Better default domain for CustomNSError
We were creating domains that looked like `"main.SomeError.Type"`
instead of the expected `"main.SomeError"`. Fix this and add some basic
tests.
2017-01-16 15:50:35 -08:00
Max Moiseev
764fc0aa13 Replacing M_PI with .pi 2017-01-13 18:25:04 -08:00
Robert Widmann
cef4e66233 Merge pull request #6776 from ArtSabintsev/feature/XCTAssertNoThrow
Implementation for XCTAssertNoThrow
2017-01-13 01:39:26 -07:00
Arthur Ariel Sabintsev
5008ed8421 Changed constant to _XCTAssertionType.noThrow 2017-01-13 02:43:11 -05:00
Arthur Ariel Sabintsev
741056578f Revert "All declarations in XCTest in SDK and XCTest in validations-tests have 2 spaces instead of 4"
This reverts commit 43a7b31490.
2017-01-13 01:38:27 -05:00
Arthur Ariel Sabintsev
43a7b31490 All declarations in XCTest in SDK and XCTest in validations-tests have 2 spaces instead of 4 2017-01-13 01:36:37 -05:00
Arthur Ariel Sabintsev
ec8e6c5a38 Changed success condition 2017-01-13 01:31:29 -05:00
Arthur Ariel Sabintsev
5f9352c8d2 Fixed indentation. 2017-01-13 01:28:53 -05:00
Arthur Ariel Sabintsev
b6d36fa86e Simplified throwable function evaluation and success case requirements. 2017-01-13 01:24:53 -05:00
Arthur Ariel Sabintsev
13094af307 Fixed indentation 2017-01-13 01:18:21 -05:00
Arthur Ariel Sabintsev
31b96ad3cd Adjusted _XCTRegisterFailure conditions. Added validation test for XCTAssertNoThrow 2017-01-13 00:41:47 -05:00
Arthur Ariel Sabintsev
7d726f2f32 Fixed smal bug with how expression was called 2017-01-13 00:20:54 -05:00
Arthur Ariel Sabintsev
f329b3b8bb Implemented assertionType in failure cases 2017-01-13 00:20:30 -05:00
Arthur Ariel Sabintsev
93bc18129f Now outputting caughtError 2017-01-13 00:17:44 -05:00
Arthur Ariel Sabintsev
e19da0b6b5 Fixed copy-paste error in error case. XCTAssertLessThanOrEqual to XCTAssertThrowsError 2017-01-13 00:09:28 -05:00
Arthur Ariel Sabintsev
e5e8eb7603 First pass at implementing XCTAssertNoThrow 2017-01-13 00:08:31 -05:00
Max Moiseev
d5e56d674f Removing explicit implementation of arithmetic operators from Decimal in favor of defaults 2017-01-12 15:54:37 -08:00
Max Moiseev
fa7368ad7d Merge remote-tracking branch 'origin/master' into new-integer-protocols 2017-01-11 14:37:01 -08:00
Syo Ikeda
b1011ca176 [Foundation][gardening] Remove unnecessary breaks 2017-01-12 02:06:56 +09:00
Tony Parker
3345050957 Merge pull request #6615 from phausler/data_append_truncation_fix
[Foundation] Correct sequence initializers for Data when repeating:count: is called and add a memset fast-path
2017-01-10 13:26:09 -08:00
Max Moiseev
aecccc7e48 Merge remote-tracking branch 'origin/master' into new-integer-protocols 2017-01-09 17:38:04 -08:00
Tony Parker
d34d36ecbc Remove errant definition of a URLResourceValue key 2017-01-09 16:13:32 -08:00
Tony Parker
1553cdecec Use the right key for the image thumbnail dictionaries in the URL
resources struct.

Fixes rdar://27556178
2017-01-09 15:10:21 -08:00
Doug Gregor
2302f59288 Merge pull request #6531 from Fruneau/indirect-fields
Clang Importer: import all indirect fields.
2017-01-09 15:01:02 -08:00
practicalswift
3918d9d251 [gardening] Replace likely word processor artefacts with ASCII equivalents (— → --, … → ...) 2017-01-08 15:23:06 +01:00
Ben Cohen
c0ecff1344 Merge pull request #6508 from airspeedswift/sprightly-look
[SDK] Change SKThings.customPlaygroundQuickLook to return a non-optional image
2017-01-07 14:27:38 -08:00
Ben Cohen
578a52627a Merge branch 'master' into se-147 2017-01-07 13:19:15 -08:00
Ben Cohen
3bdada1773 Merge pull request #6506 from airspeedswift/im-not-warning-you-again
[stdlib] Squash various warnings
2017-01-06 16:51:06 -08:00
Max Moiseev
27889c6376 Merge remote-tracking branch 'origin/master' into new-integer-protocols 2017-01-06 15:54:44 -08:00
Robert Widmann
7d427aa62e Merge pull request #6569 from mekjaer/mk-inconsistent-spacing-on-properties-and-arguments
[gardening] spacing on properties and arguments in IndexSet (stdlib)
2017-01-06 16:11:00 -07:00
Philippe Hausler
45714e6263 [Foundation] Correct sequence initializers for Data when repeating:count: is called and add a memset fast-path 2017-01-06 13:56:08 -08:00
practicalswift
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01:00
Florent Bruneau
68bc423be3 Clang Importer: import all indirect fields.
Until now, only indirect fields that didn't belong to a C union (somewhere
between the field declaration and the type in which it is indirectly
exposed) were imported in swift. This patch tries to provide an approach
that allows all those fields to be exposed in swift. However, the downside
is that we introduce new intermediate fields and types, some of the fields
may already have been manually defined in type extension (as seen with the
GLKit overlay).

The main idea here is that we can simply expose the anonymous
struct/unions from which the indirect types are taken and then use swift
computed properties to access the content of those anonymous
struct/unions. As a consequence, each time we encounter an anonymous
struct or union, we actually expose it at __Anonymous_field<id> (where id
is the index of the field in the structure). At this point, we use the
existing mechanism to expose the type as
__Unnamed_<struct|union>_<fieldname>. Then, each indirect field is exposed
as a computed property.

The C object:

 typedef union foo_t {
     struct {
         int a;
         int b;
     };
     int c;
 } foo_t;

Is imported as

 struct foo_t {
   struct __Unnamed_struct___Anonymous_field1 {
     var a : Int32
     var b : Int32
   }
   var __Anonymous_field1 : foo_t.__Unnamed_struct___Anonymous_field1
   var a : Int32 {
     get {
       return __Anonymous_field1.a
     }
     set(newValue) {
       __Anonymous_field1.a = newValue
     }
   }
   var b : Int32 {
     get {
       return __Anonymous_field1.b
     }
     set(newValue) {
       __Anonymous_field1.b = newValue
     }
   }
   var c : Int32
 }

This has the advantage to work for both struct and union, even in case we
have several nested anonymous struct/unions. This does not require to know
the size and/or the offset of the fields in the structures and thus can be
properly implemented using front-end data.

Signed-off-by: Florent Bruneau <florent.bruneau@intersec.com>
2017-01-05 22:52:25 +01:00
Ben Cohen
fefc2e40df Migrate _copyContents to be called from UnsafeMutableBufferPointer with checks for overrun. 2017-01-05 11:59:49 -08:00
Ben Cohen
4dc5eacef5 Merge branch 'master' into im-not-warning-you-again 2017-01-05 10:11:48 -08:00
mekjaer
272dfb26df Gardening spacing on properties and arguments in IndexSet (stdlib) 2017-01-04 23:09:17 +01:00
Slava Pestov
6bea9534fe Merge pull request #6523 from jpsim/jp-inconsistent-closure-spacing
[gardening] fix mismatched closure open/close spacing in stdlib source
2017-01-03 20:59:38 -08:00
JP Simard
65688bdc39 [gardening] replace unused closure parameters with '_' in stdlib source (#6522)
* replace unused closure parameters with '_' in stdlib source

* fold some _ closure arguments into line above

* fold more _ closure arguments into line above
2017-01-03 20:10:41 -07:00
Robert Widmann
fca7b66b7c Merge pull request #6521 from jpsim/jp-void-return
[gardening] prefer '-> Void' over '-> ()' in stdlib source
2017-01-03 20:10:13 -07:00
JP Simard
891729f6c2 remove redundant '-> Void' return types from functions in stdlib source
since omitting it appears to be the convention followed elsewhere in
the code base.
2017-01-03 16:38:57 -08:00
Robert Widmann
359a66488f Merge pull request #6520 from jpsim/jp-trailing-semicolon
[gardening] remove trailing semicolons in stdlib source
2017-01-03 17:31:34 -07:00