We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 8aa3c7a + eeb7b05 commit 0cdd51dCopy full SHA for 0cdd51d
include/swift/AST/Decl.h
@@ -1523,6 +1523,17 @@ class GenericContext : private _GenericContext, public DeclContext {
1523
1524
/// Determine whether this context has generic parameters
1525
/// 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
1537
bool isGeneric() const { return GenericParams != nullptr; }
1538
1539
/// Retrieve the trailing where clause for this extension, if any.
0 commit comments