Mechanically add "Type" to the end of any protocol names that don't end
in "Type," "ible," or "able." Also, drop "Type" from the end of any
associated type names, except for those of the *LiteralConvertible
protocols.
There are obvious improvements to make in some of these names, which can
be handled with separate commits.
Fixes <rdar://problem/17165920> Protocols `Integer` etc should get
uglier names.
Swift SVN r19883
native Dictionary storage and adopt it if KeyType and ValueType match
exactly
This was the last missing piece to allow Dictionary to round-trip
thorough objc entrypoints of Swift methods in O(1).
Fixes rdar://17556319, partially fixes rdar://17010353
Swift SVN r19873
types to NSDictionary, perform bridging operation in O(1), and defer
bridging of the contents until the NSDictionary is accessed
There is no cache for bridged keys and values; the Swift NSDictionary
will return values with different pointer values when a given key is
repeatedly accessed.
Part of rdar://17556319
Does not fix the O(N) performance of objc thunks, because Dictionary is
not recognizing its own native storage when bridging from Objective-C.
This tracked by rdar://17010353
Swift SVN r19853
1) Add an ObjCObject disposition that tells us this Mirror is reflecting upon an ObjC-imported type
2) Change the default summary of _ClassMirror and _StructMirror to be the mangled typename, with no children count
Swift SVN r19817
ArrayBuffer
ArrayBufferType
ContiguousArrayBuffer
ContiguousArrayStorage
IndirectArrayBuffer
SliceBuffer
Unfortunately, can not remove 'public' from them since they are used by
Foundation overlay in bridging code.
Swift SVN r19810
However, a view can ask to be redrawn by setting its needsDisplay flag to true
When this happens in a playground, the
self.needsDisplay = true line
forces the view to be logged - logging the view forces it to be redrawn, and unless there's a way out that does not force-redraw, this ends up being an endless loop & of course at some point we run out of stack, and "random" crashes ensue
Add a set of views currently being logged and add/remove views as needed to ensure we don't try to actively log the same view twice
Since UI drawing can only happen on the main thread, if you try to concurrently log views from different threads, you already have a problem, so this can be treated as a single-threaded problem
Fixes <rdar://problem/17027976>
Swift SVN r19730
Introduce the new BooleanLiteralConvertible protocol for Boolean
literals. Take "true" and "false" as real keywords (which is most of the
reason for the testsuite churn). Make Bool BooleanLiteralConvertible
and the default Boolean literal type, and ObjCBool
BooleanLiteralConvertible. Fixes <rdar://problem/17405310> and the
recent regression that made ObjCBool not work with true/false.
Swift SVN r19728
When asking XCTest to generate format strings for assertions, pass the
requested index + 100 to ask XCTest to generate a string without space
for the expressions themselves, and don't bother passing them either
(since the overlay isn't actually generating stringified expressons).
Addresses <rdar://problem/17597526>.
Swift SVN r19712
There's a regression here because we can no longer use "true" or
"false" with ObjCBool. We'll get that back when true and false become
literals.
Swift SVN r19694
CGFloat is 32-bit on 32-bit architectures and 64-bit on 64-bit
architectures for historical reasons. Rather than having it alias
either Float (32-bit) or Double (64-bit), introduce a distinct struct
type for CGFloat. CGFloat provides a complete set of comparisons and
arithmetic operators (including tgmath functions), initializers allows
explicit conversion between it an Int, UInt, Float, and Double, as
well as conforming to all of the protocols that Float/Double do.
This formulation of CGFloat makes use of CGFloat
architecture-independent, although it still requires a number of casts.
Fixes <rdar://problem/17224725>
Swift SVN r19689
Previously, bridged value types and their corresponding Objective-C
classes allow inter-conversion via a number of user-defined conversion
functions in the Foundation module. Instead, make this a general
feature of the type checker so we can reason about it more
directly. Fixes <rdar://problem/16956098> and
<rdar://problem/17134986>, and eliminates 11 (half) of the
__conversion functions from the standard library and overlays.
A few notes:
- The XCTest changes are because a String can no longer directly
conform to CVarArg: this is a Good Thing (TM), because it should be
ambiguous: did you mean to pass it as an NSString or a C string?
- The Objective-C representations for the bridged collections are
hard-coded in the type checker. This is unfortunate and can be
remedied by adding another associated type to the
_BridgedToObjectiveC protocol.
Swift SVN r19618
Foundation, and have them forward to Foundation.
This is slower than it could be, but at least this way we produce correct
results.
Another part of rdar://17550187
Swift SVN r19560
- Change the parser to accept "objc" without an @ sign as a contextual
keyword, including the dance to handle the general parenthesized case.
- Update all comments to refer to "objc" instead of "@objc".
- Update all diagnostics accordingly.
- Update all tests that fail due to the diagnostics change.
- Switch the stdlib to use the new syntax.
This does not switch all tests to use the new syntax, nor does it warn about
the old syntax yet. That will be forthcoming. Also, this needs a bit of
refactoring, which will be coming up.
Swift SVN r19555
There is some follow-up work remaining:
- test/stdlib/UnicodeTrie test kills the type checker without manual type annotations. <rdar://problem/17539704>
- test/Sema/availability test raises a type error on 'a: String == nil', which we want, but probably not as a side effect of string-to-pointer conversions. I'll fix this next.
Swift SVN r19477
COMPILE_FLAGS is currently used for two purposes:
- For any target library, add the appropriate Swift optimization flags. This eliminates the add_swift_optimization_flags boilerplate and makes these flags work for all library variants
- For the runtime, pass the appropriate define down when SWIFT_RUNTIME_CLOBBER_FREED_OBJECTS is set, so that all library variants get this setting.
Swift SVN r19444