This is to be used by playgrounds to provide a better sidebar representation of web pages than simply showing the URL text
Part of rdar://16799088
Swift SVN r17710
We still want to send out image data for those, but UI consumers need to be able to differentiate - should they so desire - a true image from a software sprite rendered in pictorial form
Part of the fix for rdar://16806238
Swift SVN r17471
This tag is meant to trade in image data, but be explicit about the fact that this is a "screenshot" of a UI view rather than a plain ol' picture
Fixes the swift library part of rdar://16796532
Swift SVN r17390
However, this broke for Swift subclasses of NSString because the Swift mirror took precedence over the ObjC NSString choice
Notably, it broke for NSContiguousString
This patch fixes that by explicitly making NSString reflectable, so that its subclasses will automagically do the right thing here
Fixes rdar://16758974
Swift SVN r17059
This is meant to represent to UI consumers the notion of a logical truth value
Previously, we were using a String case to represent such values, but that loses potentially useful information to UI layers
This fixes rdar://16719431
Swift SVN r17037
The cost of hacks to swift_conformsToProtocol is starting to outweigh any benefit to being principled here. We'll get a linker error now if multiple modules declare a conformance for the same type to the same protocol, but that's arguably a good thing for 1.0 anyway, since we aren't set up to get that right in other ways.
Swift SVN r16554
the value buffer comes first.
The motivation for doing this is similar to the
motivation for moving it for class existentials:
it eliminates the need for an offset for the most
common accesses, which is particularly important
for the generic value witnesses.
Also try to hard-code that layout in fewer places,
or at least static_assert the places that have to
do so.
Swift SVN r16279
Its layout information in the ObjC runtime is a complete lie, so we crash if we try to use it to introspect the object. Fixes <rdar://problem/16592777>.
Swift SVN r16228
Language features like erasing concrete metatype
values are also left for the future. Still, baby steps.
The singleton ordinary metatype for existential types
is still potentially useful; we allow it to be written
as P.Protocol.
I've been somewhat cavalier in making code accept
AnyMetatypeType instead of a more specific type, and
it's likely that a number of these places can and
should be more restrictive.
When T is an existential type, parse T.Type as an
ExistentialMetatypeType instead of a MetatypeType.
An existential metatype is the formal type
\exists t:P . (t.Type)
whereas the ordinary metatype is the formal type
(\exists t:P . t).Type
which is singleton. Our inability to express that
difference was leading to an ever-increasing cascade
of hacks where information is shadily passed behind
the scenes in order to make various operations with
static members of protocols work correctly.
This patch takes the first step towards fixing that
by splitting out existential metatypes and giving
them a pointer representation. Eventually, we will
need them to be able to carry protocol witness tables
Swift SVN r15716
Playgrounds want to be able to represent numbers different from strings, so provide different tags for types that represent numbers distinct from strings. Set up the Int and Double mirrors to return quick look objects of the appropriate cases, and hook up the magic ObjC mirror to do the same for NSNumbers. <rdar://problem/16360758>
Swift SVN r15219
Only the bits that actually need to grovel metadata really need to be written in C++, so define away hopefully most of the potential for memory safety or corruption bugs from screwing up calling convention matchups by moving most of the magic mirror implementations into pure Swift.
Swift SVN r15180
We want the metadata of the ObjC class, not the opaque Builtin.ObjCPointer metadata. This allows the Any to actually be downcast to an expected type on the client side.
Swift SVN r15009
Add 'Sound', 'Color', and 'BezierPath', as requested by Enrico, as well as a '_Raw' case that can be used for internal experimentation.
Swift SVN r14978
Implicit conversions to and from an unsigned long long enum class give us the calling convention we want for swift_allocBox without totally destroying the API for C callers.
Swift SVN r14919
Playgrounds want to present aggregate-like values with fixed children, such as structs and classes, differently from container-like values with variable amounts of children, like arrays and dictionaries, so add a property to Mirror that describes the disposition of the value being reflected.
Swift SVN r14827
In response to feedback from the Xcode team, change the 'IDERepresentable' type from a protocol into an enum with a limited set of tags, starting with 'Text' and 'Image' for now. In the ObjC mirror, if the ObjC object has a -debugQuickLookObject method, use it to get an object we can try to map to the enum.
Swift SVN r14632
For ObjC classes, use class_copyIvarList to walk the ivars, and produce the summary string using -debugDescription. Still to come:
- visiting the base class as a child, and
- calling -debugQuickLookObject to get the quicklook object. Still waiting on a final design for the IDERepresentation API.
Swift SVN r14626
A useful unsafe optimization for potential implementations of Mirror that have existing heap storage to share from the value, like for Array or Dictionary.
Swift SVN r14186
Define a "Mirror" protocol with methods for querying the number of children a structured value has, getting the name and mirror for each of those children, and a string and "IDE representation" of the value, as needed by playgrounds and by our planned generic printing facility.
In the runtime, define a "reflect" function that can provide a Mirror for any object, either using a "Reflectable" protocol conformance if available, or falling back to a magic implementation in the runtime that grovels the type metadata. Stub out a bare minimum default implementation.
Swift SVN r14139