Implement SE-0195, which introduces "Dynamic Member Lookup" Types (#14546)

* Implement the recently accepted SE-0195 proposal, which introduces "Dynamic
Member Lookup" Types.  This is a dusted off and updated version of PR13361,
which switches from DynamicMemberLookupProtocol to @dynamicMemberLookup as
was requested by the final review decision.  This also rebases it,
updates it for other changes in the compiler, fixes a bunch of bugs, and adds support for keypaths.  

Thank you to @rudx and @DougGregor in particular for the helpful review comments and test cases!
This commit is contained in:
Chris Lattner
2018-02-16 16:19:50 -08:00
committed by GitHub
parent 3184dd8ad4
commit a0fa5d11b4
17 changed files with 845 additions and 71 deletions

View File

@@ -1033,6 +1033,10 @@ public:
/// The locators of \c Defaultable constraints whose defaults were used.
SmallVector<ConstraintLocator *, 8> DefaultedConstraints;
/// This is a cache that keeps track of whether a given type is known (or not)
/// to be a @dynamicMemberLookup type.
///
llvm::DenseMap<Type, bool> IsDynamicMemberLookupCache;
private:
/// \brief Describe the candidate expression for partial solving.
/// This class used by shrink & solve methods which apply