Skip to content

Commit 547abf1

Browse files
committed
[AST] Fix documentation comment for SubstitutionMap.
1 parent cdff742 commit 547abf1

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

include/swift/AST/SubstitutionMap.h

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,18 @@ enum class CombineSubstitutionMaps {
4848
/// abstract types to replacement types, together with associated conformances
4949
/// to use for deriving nested types and conformances.
5050
///
51-
/// Depending on how the SubstitutionMap is constructed, the abstract types are
52-
/// either archetypes or interface types. Care must be exercised to only look
53-
/// up one or the other.
51+
/// Substitution maps are primarily used when performing substitutions into
52+
/// any entity that can reference type parameters, e.g., types (via
53+
/// Type::subst()) and conformances (via ProtocolConformanceRef::subst()).
5454
///
5555
/// SubstitutionMaps are constructed by calling the getSubstitutionMap() method
5656
/// on a GenericSignature or (equivalently) by calling one of the static
57-
/// \c SubstitutionMap::get() methods.
57+
/// \c SubstitutionMap::get() methods. However, most substitution maps are
58+
/// computed using higher-level entry points such as
59+
/// TypeBase::getMemberSubstitutionMap().
60+
///
61+
/// Substitution maps are ASTContext-allocated and are uniqued on construction,
62+
/// so they can be used as fields in AST nodes.
5863
class SubstitutionMap {
5964
public:
6065
/// Stored data for a substitution map, which uses tail allocation for the

0 commit comments

Comments
 (0)