Skip to content

Commit 0cdd51d

Browse files
committed
Merge remote-tracking branch 'origin/master' into master-rebranch
2 parents 8aa3c7a + eeb7b05 commit 0cdd51d

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

include/swift/AST/Decl.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1523,6 +1523,17 @@ class GenericContext : private _GenericContext, public DeclContext {
15231523

15241524
/// Determine whether this context has generic parameters
15251525
/// of its own.
1526+
///
1527+
/// \code
1528+
/// class C<T> {
1529+
/// func f1() {} // isGeneric == false
1530+
/// func f2<T>() {} // isGeneric == true
1531+
/// }
1532+
///
1533+
/// protocol P { // isGeneric == true due to implicit Self param
1534+
/// func p() // isGeneric == false
1535+
/// }
1536+
/// \endcode
15261537
bool isGeneric() const { return GenericParams != nullptr; }
15271538

15281539
/// Retrieve the trailing where clause for this extension, if any.

0 commit comments

Comments
 (0)