diff options
author | Jiaxiang Chen <jiaxiang@google.com> | 2022-02-14 21:43:48 -0800 |
---|---|---|
committer | Jiaxiang Chen <roaringacw@gmail.com> | 2022-02-16 11:35:07 -0800 |
commit | b698c8e0f41372659d2ff8fc8c5572f9ab804045 (patch) | |
tree | 284ab042f50c9a368e2a1558094d221f3ac0d8b1 /api | |
parent | f238eac5f77699239433f2afe24d299a97120249 (diff) | |
download | ksp-b698c8e0f41372659d2ff8fc8c5572f9ab804045.tar.gz |
Add Resolver.overrides(overrider: KSDeclaration, overridee: KSDeclaration, containingClass: KSClassDeclaration): Boolean
this function checks if a declaration is overriding another declaration in the context of contained in the containing class.
Diffstat (limited to 'api')
-rw-r--r-- | api/src/main/kotlin/com/google/devtools/ksp/processing/Resolver.kt | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/api/src/main/kotlin/com/google/devtools/ksp/processing/Resolver.kt b/api/src/main/kotlin/com/google/devtools/ksp/processing/Resolver.kt index bdadbf42..0030bfb9 100644 --- a/api/src/main/kotlin/com/google/devtools/ksp/processing/Resolver.kt +++ b/api/src/main/kotlin/com/google/devtools/ksp/processing/Resolver.kt @@ -124,6 +124,15 @@ interface Resolver { fun overrides(overrider: KSDeclaration, overridee: KSDeclaration): Boolean /** + * @param overrider the candidate overriding declaration being checked. + * @param overridee the candidate overridden declaration being checked. + * @param containingClass the containing class of candidate overriding and overridden declaration being checked. + * @return boolean value indicating whether [overrider] overrides [overridee] + * Calling [overrides] is expensive and should be avoided if possible. + */ + fun overrides(overrider: KSDeclaration, overridee: KSDeclaration, containingClass: KSClassDeclaration): Boolean + + /** * Returns the jvm name of the given function. * This function might fail due to resolution error, in case of error, null is returned. * Resolution error could be caused by bad code that could not be resolved by compiler, or KSP bugs. |