File tree Expand file tree Collapse file tree 1 file changed +8
-12
lines changed Expand file tree Collapse file tree 1 file changed +8
-12
lines changed Original file line number Diff line number Diff line change @@ -1022,21 +1022,17 @@ Type TypeBase::getTypeOfMember(const VarDecl *member) {
10221022
10231023Type TypeBase::getTypeOfMember (const ValueDecl *member,
10241024 Type memberType) {
1025- assert (memberType);
1026- assert (!memberType->is <GenericFunctionType>() &&
1027- " Generic function types are not supported" );
1025+ auto *dc = member->getDeclContext ();
10281026
1029- if (is<ErrorType>())
1030- return ErrorType::get (getASTContext ());
1027+ ASSERT (dc->isTypeContext ());
1028+ ASSERT (!memberType->is <GenericFunctionType>() &&
1029+ " Generic function types are not supported" );
1030+ ASSERT (isa<VarDecl>(member) || isa<EnumElementDecl>(member));
10311031
1032- if (auto *lvalue = getAs<LValueType>()) {
1033- auto objectTy = lvalue->getObjectType ();
1034- return objectTy->getTypeOfMember (member, memberType);
1035- }
1032+ if (!memberType->hasTypeParameter ())
1033+ return memberType;
10361034
1037- // Perform the substitution.
1038- auto substitutions = getMemberSubstitutionMap (member);
1039- return memberType.subst (substitutions);
1035+ return memberType.subst (getContextSubstitutionMap (dc));
10401036}
10411037
10421038Type TypeBase::adjustSuperclassMemberDeclType (const ValueDecl *baseDecl,
You can’t perform that action at this time.
0 commit comments