Do not count type parameters of inline class with generic underlying
value twice, when counting type parameters for inner class inside init block. #KT-32162
This commit is contained in:
@@ -17,10 +17,7 @@ import org.jetbrains.kotlin.ir.symbols.IrClassifierSymbol
|
|||||||
import org.jetbrains.kotlin.ir.symbols.IrScriptSymbol
|
import org.jetbrains.kotlin.ir.symbols.IrScriptSymbol
|
||||||
import org.jetbrains.kotlin.ir.symbols.IrTypeParameterSymbol
|
import org.jetbrains.kotlin.ir.symbols.IrTypeParameterSymbol
|
||||||
import org.jetbrains.kotlin.ir.types.impl.*
|
import org.jetbrains.kotlin.ir.types.impl.*
|
||||||
import org.jetbrains.kotlin.ir.util.defaultType
|
import org.jetbrains.kotlin.ir.util.*
|
||||||
import org.jetbrains.kotlin.ir.util.fqNameWhenAvailable
|
|
||||||
import org.jetbrains.kotlin.ir.util.isAnonymousObject
|
|
||||||
import org.jetbrains.kotlin.ir.util.isPropertyAccessor
|
|
||||||
import org.jetbrains.kotlin.name.FqName
|
import org.jetbrains.kotlin.name.FqName
|
||||||
import org.jetbrains.kotlin.types.*
|
import org.jetbrains.kotlin.types.*
|
||||||
import org.jetbrains.kotlin.types.typeUtil.makeNotNullable
|
import org.jetbrains.kotlin.types.typeUtil.makeNotNullable
|
||||||
@@ -213,6 +210,9 @@ val IrClass.typeConstructorParameters: Sequence<IrTypeParameter>
|
|||||||
}
|
}
|
||||||
parent is IrClass && current is IrClass && !current.isInner ->
|
parent is IrClass && current is IrClass && !current.isInner ->
|
||||||
null
|
null
|
||||||
|
// Inline class constructor inherits the same type parameters as the inline class itself
|
||||||
|
current.isJvmInlineClassConstructor ->
|
||||||
|
null
|
||||||
else ->
|
else ->
|
||||||
parent
|
parent
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -129,6 +129,9 @@ val IrDeclaration.isPropertyAccessor get() =
|
|||||||
val IrDeclaration.isPropertyField get() =
|
val IrDeclaration.isPropertyField get() =
|
||||||
this is IrField && this.correspondingPropertySymbol != null
|
this is IrField && this.correspondingPropertySymbol != null
|
||||||
|
|
||||||
|
val IrDeclaration.isJvmInlineClassConstructor get() =
|
||||||
|
this is IrSimpleFunction && name.asString() == "constructor-impl"
|
||||||
|
|
||||||
val IrDeclaration.isTopLevelDeclaration get() =
|
val IrDeclaration.isTopLevelDeclaration get() =
|
||||||
parent !is IrDeclaration && !this.isPropertyAccessor && !this.isPropertyField
|
parent !is IrDeclaration && !this.isPropertyAccessor && !this.isPropertyField
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user