@@ -1289,26 +1289,22 @@ class alignas(1 << TypeAlignInBits) TypeBase
12891289 // / Otherwise, it returns the type itself.
12901290 Type getReferenceStorageReferent ();
12911291
1292- // / Determine the set of substitutions that should be applied to a
1293- // / type spelled within the given DeclContext to treat it as a
1294- // / member of this type.
1292+ // / Assumes this is a nominal type. Returns a substitution map that sends each
1293+ // / generic parameter of the declaration's generic signature to the corresponding
1294+ // / generic argument of this nominal type.
12951295 // /
1296- // / For example, given:
1297- // / \code
1298- // / struct X<T, U> { }
1299- // / extension X {
1300- // / typealias SomeArray = [T]
1301- // / }
1302- // / \endcode
1296+ // / Eg: Array<Int> ---> { Element := Int }
1297+ SubstitutionMap getContextSubstitutionMap ();
1298+
1299+ // / More general form of the above that handles additional cases:
13031300 // /
1304- // / Asking for the member substitutions of \c X<Int,String> within
1305- // / the context of the extension above will produce substitutions T
1306- // / -> Int and U -> String suitable for mapping the type of
1307- // / \c SomeArray.
1301+ // / 1) dc is the nominal type itself or an unconstrained extension
1302+ // / 2) dc is a superclass
1303+ // / 3) dc is a protocol
13081304 // /
1309- // / \param genericEnv If non-null and the type is nested inside of a
1310- // / generic function, generic parameters of the outer context are
1311- // / mapped to context archetypes of this generic environment .
1305+ // / In Case 2) and 3), the substitution map has the generic signature of the dc,
1306+ // / and not the nominal. In Case 1), this is the same as the no-argument overload
1307+ // / of getContextSubstitutionMap() .
13121308 SubstitutionMap getContextSubstitutionMap (const DeclContext *dc,
13131309 GenericEnvironment *genericEnv=nullptr );
13141310
0 commit comments