add distinction between functions and methods in SIR #KT-65046 fixed

Merge-request: KT-MR-14667
Merged-by: Artem Olkov <artem.olkov@jetbrains.com>
This commit is contained in:
Artem Olkov
2024-02-29 12:52:10 +00:00
committed by Space Team
parent 12552e4e04
commit e6705e9db2
23 changed files with 138 additions and 63 deletions
@@ -6,6 +6,7 @@
package org.jetbrains.kotlin.sir.bridge
import com.intellij.testFramework.TestDataFile
import org.jetbrains.kotlin.sir.SirCallableKind
import org.jetbrains.kotlin.sir.SirNominalType
import org.jetbrains.kotlin.sir.SirParameter
import org.jetbrains.kotlin.sir.SirType
@@ -97,30 +98,34 @@ private fun readRequestFromFile(file: File): BridgeRequest {
this.name = fqName.last()
this.returnType = returnType
this.parameters += parameters
this.isStatic = false
this.kind = SirCallableKind.FUNCTION
}
BridgeRequestKind.PROPERTY_GETTER -> {
val getter = buildGetter()
val getter = buildGetter {
this.kind = SirCallableKind.FUNCTION
}
getter.parent = buildVariable {
this.name = fqName.last()
this.type = returnType
check(parameters.isEmpty())
this.isStatic = false
this.getter = getter
}
getter
}
BridgeRequestKind.PROPERTY_SETTER -> {
val setter = buildSetter()
val setter = buildSetter {
this.kind = SirCallableKind.FUNCTION
}
setter.parent = buildVariable {
this.name = fqName.last()
this.type = returnType
check(parameters.isEmpty())
this.isStatic = false
this.getter = buildGetter()
this.getter = buildGetter {
this.kind = SirCallableKind.FUNCTION
}
this.setter = setter
}