Add ExtensionMethod class

This commit is contained in:
Tamas Vajk
2021-09-23 10:11:28 +02:00
committed by Ian Lynagh
parent 7d8b6bac06
commit 3bfc93daab
5 changed files with 22 additions and 2 deletions

View File

@@ -1059,3 +1059,7 @@ ktBreakContinueTarget(
unique int id: @breakcontinuestmt ref,
int target: @ktloopstmt ref
)
ktExtensionFunctions(
unique int id: @method ref
)

View File

@@ -670,3 +670,13 @@ class Field extends Member, ExprParent, @field, Variable {
class InstanceField extends Field {
InstanceField() { not this.isStatic() }
}
/** A Kotlin extension function. */
class ExtensionMethod extends Method {
ExtensionMethod() { ktExtensionFunctions(this) }
/** Gets the type being extended by this method. */
Type getExtendedType() { result = getParameter(-1).getType() }
override string getAPrimaryQlClass() { result = "ExtensionMethod" }
}