Minor: reformat and fix warnings
This commit is contained in:
committed by
teamcityserver
parent
4fc461a2ff
commit
eec16b83c6
@@ -79,7 +79,7 @@ val IrType.classifierOrNull: IrClassifierSymbol?
|
|||||||
|
|
||||||
val IrType.classOrNull: IrClassSymbol?
|
val IrType.classOrNull: IrClassSymbol?
|
||||||
get() =
|
get() =
|
||||||
when (val classifier = classifierOrNull) {
|
when (val classifier = classifierOrNull) {
|
||||||
is IrClassSymbol -> classifier
|
is IrClassSymbol -> classifier
|
||||||
is IrScriptSymbol -> classifier.owner.targetClass
|
is IrScriptSymbol -> classifier.owner.targetClass
|
||||||
else -> null
|
else -> null
|
||||||
@@ -172,31 +172,28 @@ val IrClassSymbol.starProjectedType: IrSimpleType
|
|||||||
|
|
||||||
val IrClass.typeConstructorParameters: Sequence<IrTypeParameter>
|
val IrClass.typeConstructorParameters: Sequence<IrTypeParameter>
|
||||||
get() =
|
get() =
|
||||||
generateSequence(
|
generateSequence(this as IrTypeParametersContainer) { current ->
|
||||||
this as IrTypeParametersContainer,
|
val parent = current.parent as? IrTypeParametersContainer
|
||||||
{ current ->
|
when {
|
||||||
val parent = current.parent as? IrTypeParametersContainer
|
parent is IrSimpleFunction && parent.isPropertyAccessor -> {
|
||||||
when {
|
// KT-42151
|
||||||
parent is IrSimpleFunction && parent.isPropertyAccessor -> {
|
// Property type parameters for local classes declared inside property accessors are not captured in FE descriptors.
|
||||||
// KT-42151
|
// In order to match type parameters against type arguments in IR types translated from KotlinTypes,
|
||||||
// Property type parameters for local classes declared inside property accessors are not captured in FE descriptors.
|
// we should stop on property accessor here.
|
||||||
// In order to match type parameters against type arguments in IR types translated from KotlinTypes,
|
// NB this can potentially cause problems with inline properties with reified type parameters.
|
||||||
// we should stop on property accessor here.
|
// Ideally this should be fixed in FE.
|
||||||
// NB this can potentially cause problems with inline properties with reified type parameters.
|
null
|
||||||
// Ideally this should be fixed in FE.
|
|
||||||
null
|
|
||||||
}
|
|
||||||
current.isAnonymousObject -> {
|
|
||||||
// Anonymous classes don't capture type parameters.
|
|
||||||
null
|
|
||||||
}
|
|
||||||
parent is IrClass && current is IrClass && !current.isInner ->
|
|
||||||
null
|
|
||||||
else ->
|
|
||||||
parent
|
|
||||||
}
|
}
|
||||||
|
current.isAnonymousObject -> {
|
||||||
|
// Anonymous classes don't capture type parameters.
|
||||||
|
null
|
||||||
|
}
|
||||||
|
parent is IrClass && current is IrClass && !current.isInner ->
|
||||||
|
null
|
||||||
|
else ->
|
||||||
|
parent
|
||||||
}
|
}
|
||||||
).flatMap { it.typeParameters }
|
}.flatMap { it.typeParameters }
|
||||||
|
|
||||||
fun IrClassifierSymbol.typeWithParameters(parameters: List<IrTypeParameter>): IrSimpleType =
|
fun IrClassifierSymbol.typeWithParameters(parameters: List<IrTypeParameter>): IrSimpleType =
|
||||||
typeWith(parameters.map { it.defaultType })
|
typeWith(parameters.map { it.defaultType })
|
||||||
|
|||||||
Reference in New Issue
Block a user