Commit Graph

3245 Commits

Author SHA1 Message Date
Slava Pestov
cf91e309a1 IRGen: Fix emitTypeLayoutRef() for single-field structs with alignment
A single-field struct with an @_alignment attribute does not
have the same layout as its field.

This caused the runtime to compute incorrect layouts for
generic structs containing SIMD types.

Fixes <rdar://problem/33794343>.
2017-08-09 01:07:08 -07:00
Joe Shajrawi
78e5e25215 Temporary disable failing armv7 tests 2017-08-08 15:22:14 -07:00
Károly Lőrentey
3f9abaa1f8 [runtime] Implement sidetable path for isUniquelyReferenced
https://bugs.swift.org/browse/SR-5633
2017-08-05 20:26:28 +02:00
Philippe Hausler
d2926cfb05 Replicate NSAffineTransform logic for rotation to AffineTransform 2017-08-04 09:58:11 -07:00
Itai Ferber
bf4a12568a Add Codable conformance for URLComponents
Adopt Codable on URLComponents and add associated unit tests
2017-08-03 14:28:18 -07:00
Itai Ferber
3c49e05249 Improve readability of Codable test failure
At the cost of slight test readability, improve the diagnostics on test failure by pointing to the specific test case which failed on round-trip failure.
2017-08-03 13:31:22 -07:00
Pavel Yaskevich
9358671483 Merge pull request #11042 from xedin/rdar-32711708
[QoI] Improve diagnostics for assignment expression
2017-08-02 18:48:37 -07:00
Pavel Yaskevich
e8744af283 [QoI] Improve diagnostics for assignment expression
Currently `visitAssignExpr` always attempts to use type
derived from destination as a contextual type for assignment
source type-checking, which doesn't always lead to better
results.

Resolves: SR-5081
2017-08-02 18:17:49 -07:00
Nate Cook
4e45358a49 Merge branch 'master' into nc-dwformatting 2017-08-02 14:54:56 -05:00
Maxim Moiseev
52259b714b Merge pull request #11193 from xwu/lossless-integers
[stdlib] Conform fixed-width integer types to LosslessStringConvertible
2017-07-28 20:10:07 -07:00
Maxim Moiseev
3f993ef580 Merge pull request #11203 from moiseev/integers-revised
[stdlib] Implement updates to SE-0104
2017-07-28 16:15:57 -07:00
Max Moiseev
9a956dd581 [test] Require objc_interop for AVFoundation tests 2017-07-28 11:56:10 -07:00
Mishal Shah
64a77ca716 Update master to build with Xcode 9 beta 4, macOS 10.13, iOS 11, tvOS 11, and watchOS 4 SDKs. 2017-07-28 11:17:59 -07:00
Nate Cook
a7ce287a53 Merge branch 'master' into integers-revised 2017-07-28 12:23:48 -05:00
Michael Ilseman
befe6933a9 Merge pull request #11212 from milseman/massive_subview_controller
[stdlib] Give Substring its own views
2017-07-27 20:36:52 -07:00
Xiaodi Wu
7578822e27 Another minor fixup for type inference in expectEqualSequence 2017-07-27 18:55:41 -05:00
Xiaodi Wu
f99f03c157 Minor fixup for type inference in expectEqualSequence 2017-07-27 18:53:10 -05:00
Xiaodi Wu
14a7c78454 Update integer parsing test to use expectEqualSequence 2017-07-27 18:49:22 -05:00
Xiaodi Wu
add2bce944 Revise doc comments and add test 2017-07-26 22:57:28 -05:00
Maxim Moiseev
ec3b7d5b59 Merge pull request #11175 from moiseev/missing-default-profile
[overlay] Add back INSetProfileInCarIntent.defaultProfile for compatibliity
2017-07-26 16:54:25 -07:00
Dave Abrahams
3c6f0c3c67 [stdlib] Repair Substring -> String conversion 2017-07-26 16:02:18 -07:00
Dave Abrahams
8aabc03c75 [stdlib] Strip allocator implementation dependencies from a test
These tests depend on the specific characteristics of the memory allocator under
use.  In particular, if the allocator decides to return a larger memory block
than requested, the tests may fail.

I can only make wild guesses as to why changes to String would cause this test
to fail on Linux, but that's what we're observing.

  check failed at .../swift/validation-test/stdlib/Inputs/CommonArrayTests.gyb, line 159
  8 >= 9
2017-07-26 15:58:05 -07:00
Michael Ilseman
6cb48529a9 [stdlib] Refactor out StdlibUnittest SPI from the stdlib.
Move _lines and _split out of the standard library and into
StdlibUnittest, which is why they were there in the first place. NFC.
2017-07-26 15:58:04 -07:00
Max Moiseev
1c3e597928 [stdlib] Get rid of ArithmeticOverflow type 2017-07-26 11:09:36 -07:00
Maxim Moiseev
a5ff35cd41 [stdlib] extendingOrTruncating: => truncatingIfNeeded: 2017-07-26 11:09:36 -07:00
Michael Ilseman
2f0dafbac3 Merge pull request #11191 from milseman/very_persistent
[stdlib] Fix bug in Substring's _persistentContent
2017-07-26 08:57:53 -07:00
Max Moiseev
7569dc9585 "[overlay] Add back INSetProfileInCarIntent.defaultProfile for compatibliity
<rdar://problem/33457609>
2017-07-25 15:19:43 -07:00
Michael Ilseman
10e9e336fe [stdlib] Fix bug in Substring's _persistentContent
Substring's _persistentContent has a fast path that avoids a copy when
the Substring represents the entire outer String. It correctly
detected situations where the wrapped _StringCore was not itself a
slice, but was omitting the extra checks to make sure the Substring's
own range covered the entire String.

Test added.
2017-07-25 14:28:57 -07:00
swift-ci
5684766a83 Merge pull request #11167 from DougGregor/nscolor-literal-extended-srgb 2017-07-25 09:19:32 -07:00
Doug Gregor
8b3889a0a3 [AppKit overlay] Use NSColor(red:green:blue:alpha:) for color literals.
This initializer, which is the same on iOS, allows negative values and
values > 1.0 to support the extended sRGB color space.

Fixes rdar://problem/33500905.
2017-07-25 07:58:20 -07:00
Itai Ferber
c962bdb56c Merge pull request #11148 from itaiferber/indexset-rangeview-fixes
Fix IndexSet.RangeView indexing with subranges
2017-07-24 19:32:50 -07:00
Nate Cook
e3e36f75a8 [test] Increase DoubleWidth bit shifting test coverage 2017-07-24 19:35:59 -05:00
Itai Ferber
cb6b3123bf Merge pull request #11138 from itaiferber/nsnumber-custom-anyhashable-fix
NSNumber custom AnyHashable fix
2017-07-24 16:03:26 -07:00
Itai Ferber
b05866a92f Fix IndexSet.RangeView indexing with subranges
On initialization, IndexSet.RangeView made the erroneous assumption that given an intersection range, a nil _indexOfRange(containing: bound) indicated that the bound was beyond the beginning or end of the index set. Instead, the index could simply not exist.

We now calculate the actual intersection of the parent index set with the given intersection range and use that as the index set to view.

This also makes the unit tests for testing range views more comprehensive.
2017-07-24 15:32:03 -07:00
Ben Cohen
ddea636951 [stdlib] Have Substring.filter return a String (#10871)
* Have Substring.filter return a String

* fix spacing nits

new machine so editor misconfigured excuses excuses

* fix spacing nits
2017-07-24 15:23:30 -07:00
Itai Ferber
aa317ba860 Add ObjC unit test to verify NSNumber bridging 2017-07-24 13:20:02 -07:00
Itai Ferber
794243eba4 Add NSNumber AnyHashable bridging test 2017-07-24 12:51:41 -07:00
Dave Abrahams
31341e6753 Merge pull request #10976 from d-ronnqvist/reduce-with-inout
[stdlib] Implement SE-0171: Reduce with inout
2017-07-23 19:57:25 -07:00
Dave Abrahams
05ff40d125 [stdlib] Backward-compatible String.UTF8View slicing
When slicing String.UTF8View in Swift 3 mode, in the absence of type
context, produce String.UTF8View.
2017-07-20 14:54:16 -07:00
Michael Gottesman
1991d0e7d5 Merge pull request #11060 from gottesmm/disable_tests
Disable some failing tests while I look into a solution.
2017-07-19 23:57:39 -07:00
Itai Ferber
f6e48dceb6 Merge pull request #11025 from michael-lehew/codable_support_for_nsarchival
NSKeyed{Una,A}rchiver should support Codable
2017-07-19 19:11:57 -07:00
Michael LeHew
ef35a001e6 NSKeyed{Una,A}rchiver should support Codable 2017-07-19 16:43:55 -07:00
Michael Gottesman
ab6a4f5249 Disable some failing tests.
rdar://33358110
2017-07-19 16:25:39 -07:00
Dave Abrahams
ff07df8df3 Merge pull request #11006 from apple/bidirectional-utf8-view
[stdlib] Make String.UTF8View bidirectional
2017-07-17 21:40:34 -07:00
Dave Abrahams
e6519fbd2b [stdlib] Make String.UTF8View bidirectional
This is a step along the way toward handling backward-compatiblity of UTF8View
slicing and preventing inadvertent creation of String instances that keep
inaccessible memory alive.
2017-07-17 13:53:45 -07:00
Ben Cohen
4d7ae8ca85 [stdlib] Fix array slice self-assignment bug (#10958)
* Fix bug where assigning from self wasn't checking bounds of the assigned slice matched

* break up if statement
2017-07-17 13:09:35 -07:00
Joe Groff
e2dc62b207 Merge pull request #11004 from jckarter/iuo-key-path
Handle IUO unwraps in key paths.
2017-07-17 12:02:30 -07:00
Joe Groff
69a290edda Handle IUO unwraps in key paths.
In the type checker, we need to recognize when a member lookup succeeded through an IUO unwrap, and insert the implicit optional-unwrap component into the key path. In the standard library, we need to cope with the fact that IUO is still a first-class type with unique type metadata in a few places. Fix for rdar://problem/33230845.
2017-07-17 11:21:36 -07:00
Maxim Moiseev
3a1d6e1ebf Merge pull request #10980 from moiseev/uikit-drag-drop
[overlay] Add NSItemProviderReading/Writing methods to UIKit overlay
2017-07-17 10:44:14 -07:00
David Rönnqvist
b5d47fc37b [stdlib] Add unit tests for the two reduce variants
This checks:
 - The examples from the documentation of `reduce(_:_:)` and `reduce(into:_:)`.
 - Different levels of inference in the closure arguments being passed.
 - That the value passed as the `initialResult` remains unmodified.
2017-07-16 17:08:15 +02:00