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) {
1022
1022
1023
1023
Type TypeBase::getTypeOfMember (const ValueDecl *member,
1024
1024
Type memberType) {
1025
- assert (memberType);
1026
- assert (!memberType->is <GenericFunctionType>() &&
1027
- " Generic function types are not supported" );
1025
+ auto *dc = member->getDeclContext ();
1028
1026
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));
1031
1031
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;
1036
1034
1037
- // Perform the substitution.
1038
- auto substitutions = getMemberSubstitutionMap (member);
1039
- return memberType.subst (substitutions);
1035
+ return memberType.subst (getContextSubstitutionMap (dc));
1040
1036
}
1041
1037
1042
1038
Type TypeBase::adjustSuperclassMemberDeclType (const ValueDecl *baseDecl,
You can’t perform that action at this time.
0 commit comments