creating a Dictionary from a dictionary literal
Also fixes rdar://16876745, because once the code moved to using lower-level
interfaces, it became trivial to detect duplicate keys without a performance
hit.
Swift SVN r18193
... unless we actually hit one of the confusing cases involving
multi-dimensional arrays (e.g., Int[]?[]), at which point one needs to
write parentheses <rdar://problem/16737035>.
Swift SVN r18181
Once we know that the storage is contiguous we use the new API _NthContiguous.
We can further optimize this code by specializing the access to ascii or UTF-16.
Swift SVN r18167
I suspect this can be made much better. It only
works for comparing Array<T> and Array<T>,
NativeArray<T> and NativeArray<T>, etc., not
NativeArray<T> and Array<T>. I also suspect
the implementation can be made better. The goal
was to make this functional, as this basic
functionality was missing.
Implements <rdar://problem/16768095>.
Swift SVN r18150
The _native computed property that backs this method has a different
contract than requestNativeBuffer() expected: it returned an empty
buffer rather than using an optional and returning nil. We were just
wrapping up that empty buffer and declaring success, which meant we
would bridge from an NSArray wrapping native storage of T to an empty
native array, always.
This change is a necessary prerequisite to importing NSArray* as
(AnyObject[])! per <rdar://problem/16535097>. That (imminent) change
tests this, but we need more targetted testing of this area.
Swift SVN r18143
This is a better solution to <rdar://problem/16899681> because the
runtime magic is limited to implementing the witnesses of this
conformance.
The type checker fixes are because we can end up using unchecked
optionals in more places, via bridging, than we could before.
Swift SVN r18120
Empty NSArrays are usually represented by emptyNSSwiftArray, whose
element type is irrelevant. So when doing a getObjects:range: on that,
presumably the range's length is zero and we shouldn't do any sanity
checking w.r.t. the element type.
Fixes <rdar://problem/16914909> Assertion failed attempting to append
arrays when subclassing Cocoa class
Swift SVN r18110
String interpolation invokes convertFromStringInterpolationSegment() function
now. There is no need to add extensions to String to allow custom types to
participate in string interpolation. Just implementing Printable will do the
right thing.
Swift SVN r18104
It is replaced by debugPrint() family of functions, that are called by REPL.
There is a regression in printing types that don't conform to Printable, this
is tracked by rdar://16898708
Swift SVN r18006
The old ones were:
- print/println
- printAny
- printf
- Console
The new printing story is just print/println. Every object can be printed.
You can customize the way it is printed by adopting Printable protocol. Full
details in comments inside stdlib/core/OutputStream.swift.
Printing is not completely finished yet. We still have ReplPrintable, which
should be removed, string interpolation still uses String constructors, and
printing objects that don't conform to Printable will result in printing
mangled names.
Swift SVN r18001