Slava Pestov
1368db7872
IRGen: Fix layout of concrete subclasses of generic subclasses of imported Objective-C classes
...
class B<T> : NSFoo {}
class A : B<Int> {}
IRGen computes the ivar layout starting from offset zero, since
the size of the 'NSFoo' is unknown and we rely on the Objective-C
runtime to slide the ivar offsets.
The instantiated metadata for B<Int> would contain a field offset
vector with the correct offsets, because of how
swift_initClassMetadata_UniversalStrategy() works.
However, A's metadata is emitted statically, and this includes a
copy of the field offset vector from the superclass. A's metadata
was initialized by swift_initializeSuperclass(), which did not
copy the field offset vector over from A<Int>. And since the
Objective-C runtime only slides the immediate ivars of a class,
the field offsets corresponding to A<Int>'s fields in B's type
metadata were never slid, resulting in problems when an instance
of B was passed to a function operating on an A<T> generically.
Fixes <rdar://problem/23200051>.
2015-12-21 16:23:39 -08:00
Chris Lattner
0caebf2fb4
Remove the last uses of ++/-- from the stdlib directory.
2015-12-21 15:11:49 -08:00
Chris Lattner
7280506e18
Merge pull request #715 from practicalswift/word-word-fixes
...
[Typo] Remove immediately adjacent repeated words ("the the", "for for", "an an", etc.).
2015-12-21 13:17:16 -08:00
practicalswift
36d7072013
Remove immediately adjacent repeated words ("the the", "for for", "an an", etc.).
2015-12-21 22:16:04 +01:00
Joe Groff
53e38907e9
Remove unused #include.
2015-12-21 12:18:57 -08:00
Davide Italiano
8f301b6554
[stdlib] Initial FreeBSD port.
2015-12-21 20:12:56 +00:00
Max Moiseev
2f7b64e475
Merge remote-tracking branch 'origin' into swift-3-api-guidelines
2015-12-21 12:02:13 -08:00
Dmitri Gribenko
69b4a81896
stdlib: re-add 'anyGenerator()' as a deprecated function
...
This is done to restore source compatibility with Swift 2.0.
2015-12-21 11:43:21 -08:00
Dmitri Gribenko
1e6e124326
Merge pull request #692 from practicalswift/fix-incorrect-filenames
...
Fix incorrect filenames in headers
2015-12-21 00:00:43 -08:00
practicalswift
cd7d8dfaff
Fix alignment as requested by @gribozavr in #692
2015-12-21 08:54:24 +01:00
Dmitri Gribenko
2ed81bd19a
Revert "[stdlib][performance] skip copying old values during removeAll(keepCapacity: true)"
2015-12-20 22:46:56 -08:00
Dmitri Gribenko
2e0efaee69
Revert "[Performance] iterate the smaller set during Set.intersect()"
2015-12-20 22:45:30 -08:00
ken0nek
c64974bb40
Use "is None" and add space after comma
2015-12-21 14:20:54 +09:00
Dmitri Gribenko
c486a3a6e2
Merge pull request #680 from PatrickPijnappel/bit-fix
...
[stdlib] Fix bug in Bit with-overflow arithmetic
2015-12-20 18:58:42 -08:00
Dmitri Gribenko
1f950762bb
Merge pull request #613 from PatrickPijnappel/int-parse-fix
...
[stdlib] Fix Int(_:radix:) accepting unintentional cases (SR-187)
2015-12-20 18:45:53 -08:00
Patrick Pijnappel
17a5845640
[stdlib] Add terminating period to comments
2015-12-21 13:31:34 +11:00
Patrick Pijnappel
4faa43aa88
[stdlib] Adjust formatting to fit 80 colums
2015-12-21 13:23:12 +11:00
Patrick Pijnappel
f81968341d
[stdlib] Adjust formatting to fit 80 columns
2015-12-21 13:06:24 +11:00
practicalswift
176f487d76
Fix incorrect filenames in headers.
2015-12-20 23:59:05 +01:00
Daniel Duan
ae601d2744
replace NULL with nullptr
2015-12-20 13:28:21 -08:00
Patrick Pijnappel
f8c155a80e
[stdlib] Refactor Bit._withOverflow()
2015-12-20 17:41:49 +11:00
Patrick Pijnappel
56ed11ee3d
[stdlib] Refactor local variables names
2015-12-20 17:29:54 +11:00
Patrick Pijnappel
9f162728f1
[stdlib] Fix bug in Bit with-overflow arithmetic
...
The original version would result in a crash for negative results.
2015-12-20 17:21:13 +11:00
Dmitri Gribenko
6f8bee17aa
Merge pull request #576 from dduan/set_intersect_optimization
...
[Performance] iterate the smaller set during Set.intersect()
2015-12-19 17:26:42 -08:00
Daniel Duan
d919f4cb5c
[stdlib] iterate the smaller set in Set.intersect()
...
This introduces a small constant in speed, but it's a big win for
worst case scenario.
2015-12-19 04:26:44 -08:00
Dmitri Gribenko
0c3f2e8b11
Merge pull request #657 from PatrickPijnappel/enums
...
[stdlib] Remove redundant CustomStringConvertible conformance
2015-12-19 03:09:25 -08:00
Pavel Mazurin
1dae128c83
Gets rid of for-loop deprecation compiler warnings in stdlib/private
2015-12-19 09:37:03 +01:00
Patrick Pijnappel
b5c3e23c40
[stdlib] Remove redundant CustomStringConvertible conformance
...
The implementation is identical to the default string representation. The conformance and description property are never explicitly used.
2015-12-19 18:05:46 +11:00
Max Moiseev
b2277939fe
Fixing tests
2015-12-18 16:22:24 -08:00
Max Moiseev
bc942090ee
cleaning up initializePointee/deinitializePointee, error messages and comments
2015-12-18 16:22:24 -08:00
Dmitri Gribenko
7e375df888
startsWith(): other => possiblePrefix
2015-12-18 16:22:24 -08:00
Dmitri Gribenko
1e26d22d80
IteratorOverOne.init(_:) => internal
2015-12-18 16:22:24 -08:00
Dmitri Gribenko
c07056ddaf
Mirrors: T => Subject
2015-12-18 16:22:24 -08:00
Dmitri Gribenko
e7b2666118
Set: maybeSuperset => possibleSuperset in argument labels
2015-12-18 16:22:24 -08:00
Dmitri Gribenko
06577273e9
var Sequence.enumerated => func
2015-12-18 16:22:24 -08:00
Max Moiseev
5ccc258f71
func underestimatedLength() => var underestimatedLength { get }
2015-12-18 16:22:24 -08:00
Max Moiseev
b3fcc5fefa
underestimateLength() => underestimatedLength()
2015-12-18 16:22:24 -08:00
Dave Abrahams
d72932e931
Replace Unmanaged with UnsafeReference
2015-12-18 16:22:24 -08:00
Dmitri Gribenko
f6c00e8377
String: var lowercased, uppercased => func
2015-12-18 16:20:01 -08:00
Dmitri Gribenko
2245f7505f
func _unsafeUnwrap() => var _unsafelyUnwrapped
2015-12-18 16:20:01 -08:00
Dmitri Gribenko
47d48e45ba
func customPlaygroundQuickLook() => var
2015-12-18 16:20:01 -08:00
Dmitri Gribenko
117b65393b
func customMirror() => var
2015-12-18 16:20:01 -08:00
Max Moiseev
3ab767a604
func superclassMirror() => var superclassMirror {get}
2015-12-18 16:20:01 -08:00
Max Moiseev
bbfcab8734
func isEmptyInput => var isEmptyInput {get}
2015-12-18 16:20:01 -08:00
Max Moiseev
50371821fe
reverse() => reversed()
2015-12-18 16:20:01 -08:00
Max Moiseev
e175a841bf
Unmanaged<T>.toOpaque() => OpaquePointer.init<T>()
2015-12-18 16:20:01 -08:00
Max Moiseev
497b348686
turning UnicodeScalar.isASCII etc into properties
2015-12-18 16:20:01 -08:00
Max Moiseev
ddd45f584d
Revert "removing Collection.split(_ separator: ...) in favor of the one in Sequence"
...
This reverts commit 6431d39f7ef3db7f434005a4df5971318c42a817.
2015-12-18 16:20:01 -08:00
Dmitri Gribenko
5498aa1938
stride(to:by:) => strideTo(_:by:)
...
and `stride(through:by:)` => `strideThrough(_:by:)`
2015-12-18 16:20:01 -08:00
Dmitri Gribenko
77376883f4
Collection.sortInPlace() => .sort()
2015-12-18 16:20:01 -08:00