Fixes a crash when property behavior uses are run through the specializer, since they set up associated type conformances that are not recoverable by name lookup.
This eliminates some minor overheads, but mostly it eliminates
a lot of conceptual complexity due to the overhead basically
appearing outside of its context.
The main idea here is that we really, really want to be
able to recover the protocol requirement of a conformance
reference even if it's abstract due to the conforming type
being abstract (e.g. an archetype). I've made the conversion
from ProtocolConformance* explicit to discourage casual
contamination of the Ref with a null value.
As part of this change, always make conformance arrays in
Substitutions fully parallel to the requirements, as opposed
to occasionally being empty when the conformances are abstract.
As another part of this, I've tried to proactively fix
prospective bugs with partially-concrete conformances, which I
believe can happen with concretely-bound archetypes.
In addition to just giving us stronger invariants, this is
progress towards the removal of the archetype from Substitution.
AnyObject conformances are weird beasts, because we're able to
synthesize them fairly arbitrarily for classes. Do so also within
substitution into a Substitution, fixing rdar://problem/20338028.
Longer term, the AnyObject protocol needs to die.
Swift SVN r28118
Replace the 'ignoreMissing' boolean flag with a new option set type,
SubstOptions, which is easier to extend. It is not an OptionSet<>
because a follow-on commit will introduce a non-trivial option that
will require more storage.
Also eliminate the LazyResolver parameter, which is no longer
needed. Eliminate the silly TypeChecker::substType(), whose only
purpose was to provide the resolver.
Swift SVN r27656
The class-constrained generic has no conformances to substitute for, so
we should just bail out early rather than expecting to find a
conformance for each thing the archetype conforms to.
Fixes rdar://problem/19336878.
Swift SVN r24583
Make it easier to get the "do I expect null ProtocolConformance* pointers" logic right. Audit existing uses of is<ArchetypeType>() for this purpose.
Swift SVN r23479
And fix some bugs with existential conformances, where we were creating a bogus conformance instead of just using null conformances like other code expects.
Swift SVN r23461
Expose Substitution's archetype, replacement, and conformances only through getters so we can actually assert invariants about them. To start, require replacement types to be materializable in order to catch cases where the type-checker tries to bind type variables to lvalue or inout types, and require the conformance array to match the number of protocol conformances required by the archetype. This exposes some latent bugs in the test suite I've marked as failures for now:
- test/Constraints/overload.swift was quietly suffering from <rdar://problem/17507421>, but we didn't notice because we never tried to codegen it.
- test/SIL/Parser/array_roundtrip.swift doesn't correctly roundtrip substitutions, which I filed as <rdar://problem/17781140>.
Swift SVN r20418