forked from android/kotlin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
KSFunctionDeclaration.kt
55 lines (47 loc) · 1.71 KB
/
KSFunctionDeclaration.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
* Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.ksp.symbol
/**
* A function definition
*
* Dispatch receiver can be obtained through [parentDeclaration].
*/
interface KSFunctionDeclaration : KSDeclaration, KSDeclarationContainer {
/**
* Kind of this function.
*/
val functionKind: FunctionKind
/**
* Whether this function is abstract.
*/
val isAbstract: Boolean
/**
* Extension receiver of this function
* @see [https://kotlinlang.org/docs/reference/extensions.html#extension-functions]
*/
val extensionReceiver: KSTypeReference?
/**
* Return type of this function.
* Can be null if an error occurred during resolution.
*/
val returnType: KSTypeReference?
/**
* [variable parameters][KSVariableParameter] of this function.
*/
val parameters: List<KSVariableParameter>
/**
* Checks if this function overrides another function.
* @param overridee the candidate overridden function being checked.
* @return boolean value indicating whether this function overrides [overridee]
* Calling [overrides] is expensive and should be avoided if possible.
*/
fun overrides(overridee: KSFunctionDeclaration): Boolean
/**
* Find the original overridee of this function, if overriding.
* @return [KSFunctionDeclaration] for the original function, if overriding, otherwise null.
* Calling [findOverridee] is expensive and should be avoided if possible.
*/
fun findOverridee(): KSFunctionDeclaration?
}