Skip to content

Commit 0d7a07c

Browse files
committed
AST: Add a couple of comments noting that UnboundGenericType is deprecated
1 parent 9587d41 commit 0d7a07c

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

include/swift/AST/Decl.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2986,6 +2986,11 @@ class TypeAliasDecl : public GenericTypeDecl {
29862986
Type getCachedUnderlyingType() const { return UnderlyingTy.getType(); }
29872987

29882988
/// For generic typealiases, return the unbound generic type.
2989+
///
2990+
/// Since UnboundGenericType is on its way out, so is this method. Try to
2991+
/// avoid introducing new callers if possible. Instead of passing around
2992+
/// an UnboundGenericType, considering passing around the Decl itself
2993+
/// instead.
29892994
UnboundGenericType *getUnboundGenericType() const;
29902995

29912996
/// Retrieve a sugared interface type containing the structure of the interface
@@ -3372,6 +3377,11 @@ class NominalTypeDecl : public GenericTypeDecl, public IterableDeclContext {
33723377

33733378
/// getDeclaredType - Retrieve the type declared by this entity, without
33743379
/// any generic parameters bound if this is a generic type.
3380+
///
3381+
/// Since UnboundGenericType is on its way out, so is this method. Try to
3382+
/// avoid introducing new callers if possible. Instead of passing around
3383+
/// an UnboundGenericType, considering passing around the Decl itself
3384+
/// instead.
33753385
Type getDeclaredType() const;
33763386

33773387
/// getDeclaredInterfaceType - Retrieve the type declared by this entity, with

include/swift/AST/Types.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2179,6 +2179,8 @@ END_CAN_TYPE_WRAPPER(TupleType, Type)
21792179

21802180
/// UnboundGenericType - Represents a generic type where the type arguments have
21812181
/// not yet been resolved.
2182+
///
2183+
/// This type is on its way out. Try to avoid introducing new usages.
21822184
class UnboundGenericType : public AnyGenericType,
21832185
public llvm::FoldingSetNode {
21842186
private:

0 commit comments

Comments
 (0)