Merge pull request #24808 from xedin/cleaner-foreach

[TypeChecker] Simplify for ... in ... type checking
This commit is contained in:
Pavel Yaskevich
2019-05-16 00:16:46 -07:00
committed by GitHub
9 changed files with 72 additions and 83 deletions

View File

@@ -2200,6 +2200,8 @@ Type simplifyTypeImpl(ConstraintSystem &cs, Type type, Fn getFixedTypeFn) {
// FIXME: It's kind of weird in general that we have to look
// through lvalue, inout and IUO types here
Type lookupBaseType = newBase->getWithoutSpecifierType();
if (auto selfType = lookupBaseType->getAs<DynamicSelfType>())
lookupBaseType = selfType->getSelfType();
if (lookupBaseType->mayHaveMembers() ||
lookupBaseType->is<DynamicSelfType>()) {