IR: add IrBasedDescriptors
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -383,13 +383,6 @@ open class WrappedSimpleFunctionDescriptor(
|
||||
sourceElement: SourceElement = SourceElement.NO_SOURCE
|
||||
) : 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 getContainingDeclaration(): DeclarationDescriptor = getContainingDeclaration(owner)
|
||||
@@ -632,12 +625,23 @@ open class WrappedClassDescriptor(
|
||||
private val _typeConstructor: TypeConstructor by lazy {
|
||||
LazyTypeConstructor(
|
||||
this,
|
||||
{ declaredTypeParameters },
|
||||
::collectTypeParameters,
|
||||
{ owner.superTypes.map { it.toKotlinType() } },
|
||||
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 isInner() = owner.isInner
|
||||
|
||||
Reference in New Issue
Block a user