@@ -1116,10 +1116,22 @@ class alignas(1 << TypeAlignInBits) TypeBase {
11161116 TypeSubstitutionMap getMemberSubstitutions (const ValueDecl *member,
11171117 GenericEnvironment *genericEnv=nullptr );
11181118
1119+ // / Retrieve the type of the given property as seen through the given base
1120+ // / type, substituting generic arguments where necessary. This is the same as
1121+ // / the more general overload of \c TypeBase::getTypeOfMember, but defaults to
1122+ // / the property's interface type for the \c memberType.
1123+ // /
1124+ // / \param module The module in which the substitution occurs.
1125+ // /
1126+ // / \param member The property whose type we are substituting.
1127+ // /
1128+ // / \returns The resulting property type.
1129+ Type getTypeOfMember (ModuleDecl *module , const VarDecl *member);
1130+
11191131 // / Retrieve the type of the given member as seen through the given base
11201132 // / type, substituting generic arguments where necessary.
11211133 // /
1122- // / This routine allows one to take a concrete type (the "this " type) and
1134+ // / This routine allows one to take a concrete type (the "self " type) and
11231135 // / and a member of that type (or one of its superclasses), then determine
11241136 // / what type an access to that member through the base type will have.
11251137 // / For example, given:
@@ -1130,20 +1142,23 @@ class alignas(1 << TypeAlignInBits) TypeBase {
11301142 // / }
11311143 // / \endcode
11321144 // /
1133- // / Given the type \c Vector<Int> and the member \c add, the resulting type
1134- // / of the member will be \c (self : Vector<Int>) -> (value : Int) -> () .
1145+ // / Given the type \c Vector<Int>, the member \c add, and its method interface
1146+ // / type (value: T) -> Void the resulting type will be (value: Int) -> Void .
11351147 // /
11361148 // / \param module The module in which the substitution occurs.
11371149 // /
11381150 // / \param member The member whose type we are substituting.
11391151 // /
1140- // / \param memberType The type of the member, in which archetypes will be
1141- // / replaced by the generic arguments provided by the base type. If null,
1142- // / the member's type will be used.
1152+ // / \param memberType The type of the member in which generic parameters will
1153+ // / be replaced by the generic arguments provided by the base type. Note this
1154+ // / must not be a GenericFunctionType. For a method, either strip the self
1155+ // / parameter and generic signature using e.g \c getMethodInterfaceType, or
1156+ // / use \c substGenericArgs if you want to substitute types for any of the
1157+ // / method's generic parameters.
11431158 // /
1144- // / \returns the resulting member type.
1159+ // / \returns The resulting member type.
11451160 Type getTypeOfMember (ModuleDecl *module , const ValueDecl *member,
1146- Type memberType = Type () );
1161+ Type memberType);
11471162
11481163 // / Get the type of a superclass member as seen from the subclass,
11491164 // / substituting generic parameters, dynamic Self return, and the
0 commit comments