IR: add IrBasedDescriptors
This commit is contained in:
+1
-1
@@ -241,7 +241,7 @@ class IrExpressionLambdaImpl(
|
|||||||
|
|
||||||
override val invokeMethodDescriptor: FunctionDescriptor =
|
override val invokeMethodDescriptor: FunctionDescriptor =
|
||||||
// Need the descriptor without captured parameters here.
|
// Need the descriptor without captured parameters here.
|
||||||
(function.descriptor as? WrappedSimpleFunctionDescriptor)?.originalDescriptor ?: function.descriptor
|
function.originalFunction.descriptor
|
||||||
|
|
||||||
override val hasDispatchReceiver: Boolean = false
|
override val hasDispatchReceiver: Boolean = false
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -383,13 +383,6 @@ open class WrappedSimpleFunctionDescriptor(
|
|||||||
sourceElement: SourceElement = SourceElement.NO_SOURCE
|
sourceElement: SourceElement = SourceElement.NO_SOURCE
|
||||||
) : SimpleFunctionDescriptor, WrappedCallableDescriptor<IrSimpleFunction>(annotations, sourceElement) {
|
) : SimpleFunctionDescriptor, WrappedCallableDescriptor<IrSimpleFunction>(annotations, sourceElement) {
|
||||||
|
|
||||||
// TODO: Remove as soon as all IR declarations have their originalDescriptor.
|
|
||||||
constructor(originalDescriptor: FunctionDescriptor) : this(originalDescriptor.annotations, originalDescriptor.source) {
|
|
||||||
this.originalDescriptor = originalDescriptor
|
|
||||||
}
|
|
||||||
|
|
||||||
var originalDescriptor: FunctionDescriptor? = null
|
|
||||||
|
|
||||||
override fun getOverriddenDescriptors() = owner.overriddenSymbols.map { it.descriptor }
|
override fun getOverriddenDescriptors() = owner.overriddenSymbols.map { it.descriptor }
|
||||||
|
|
||||||
override fun getContainingDeclaration(): DeclarationDescriptor = getContainingDeclaration(owner)
|
override fun getContainingDeclaration(): DeclarationDescriptor = getContainingDeclaration(owner)
|
||||||
@@ -632,12 +625,23 @@ open class WrappedClassDescriptor(
|
|||||||
private val _typeConstructor: TypeConstructor by lazy {
|
private val _typeConstructor: TypeConstructor by lazy {
|
||||||
LazyTypeConstructor(
|
LazyTypeConstructor(
|
||||||
this,
|
this,
|
||||||
{ declaredTypeParameters },
|
::collectTypeParameters,
|
||||||
{ owner.superTypes.map { it.toKotlinType() } },
|
{ owner.superTypes.map { it.toKotlinType() } },
|
||||||
LockBasedStorageManager.NO_LOCKS
|
LockBasedStorageManager.NO_LOCKS
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun collectTypeParameters(): List<TypeParameterDescriptor> =
|
||||||
|
generateSequence(owner as IrTypeParametersContainer,
|
||||||
|
{ current ->
|
||||||
|
val parent = current.parent as? IrTypeParametersContainer
|
||||||
|
if (parent is IrClass && current is IrClass && !current.isInner) null
|
||||||
|
else parent
|
||||||
|
})
|
||||||
|
.flatMap { it.typeParameters }
|
||||||
|
.map { it.descriptor }
|
||||||
|
.toList()
|
||||||
|
|
||||||
override fun getTypeConstructor(): TypeConstructor = _typeConstructor
|
override fun getTypeConstructor(): TypeConstructor = _typeConstructor
|
||||||
|
|
||||||
override fun isInner() = owner.isInner
|
override fun isInner() = owner.isInner
|
||||||
|
|||||||
Reference in New Issue
Block a user