Migrate descriptor-related util from IR to FE1.0
so that FE1.0 UAST can avoid depending on backend IR ^KTIJ-23602
This commit is contained in:
@@ -27,4 +27,24 @@ fun PropertyAccessorDescriptor.hasBody(): Boolean {
|
||||
|
||||
fun isBackingFieldReference(descriptor: DeclarationDescriptor?): Boolean {
|
||||
return descriptor is SyntheticFieldDescriptor
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return naturally-ordered list of the parameters that can have values specified at call site.
|
||||
*/
|
||||
val CallableDescriptor.explicitParameters: List<ParameterDescriptor>
|
||||
get() {
|
||||
val result = ArrayList<ParameterDescriptor>(valueParameters.size + 2)
|
||||
|
||||
this.dispatchReceiverParameter?.let {
|
||||
result.add(it)
|
||||
}
|
||||
|
||||
this.extensionReceiverParameter?.let {
|
||||
result.add(it)
|
||||
}
|
||||
|
||||
result.addAll(valueParameters)
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
+1
-24
@@ -16,10 +16,7 @@
|
||||
|
||||
package org.jetbrains.kotlin.backend.common.descriptors
|
||||
|
||||
import org.jetbrains.kotlin.descriptors.CallableDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.ConstructorDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.FunctionDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.ParameterDescriptor
|
||||
import org.jetbrains.kotlin.descriptors.*
|
||||
import org.jetbrains.kotlin.name.Name
|
||||
|
||||
val String.synthesizedName: Name get() = Name.identifier(this.synthesizedString)
|
||||
@@ -40,23 +37,3 @@ val CallableDescriptor.allParameters: List<ParameterDescriptor>
|
||||
} else {
|
||||
explicitParameters
|
||||
}
|
||||
|
||||
/**
|
||||
* @return naturally-ordered list of the parameters that can have values specified at call site.
|
||||
*/
|
||||
val CallableDescriptor.explicitParameters: List<ParameterDescriptor>
|
||||
get() {
|
||||
val result = ArrayList<ParameterDescriptor>(valueParameters.size + 2)
|
||||
|
||||
this.dispatchReceiverParameter?.let {
|
||||
result.add(it)
|
||||
}
|
||||
|
||||
this.extensionReceiverParameter?.let {
|
||||
result.add(it)
|
||||
}
|
||||
|
||||
result.addAll(valueParameters)
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user