Fix compiler errors in compiler detected after enabling @OnlyInputTypes in NI
This commit is contained in:
+1
-1
@@ -238,7 +238,7 @@ class DiagnosticReporterByTrackingStrategy(
|
||||
argument?.let {
|
||||
it.safeAs<LambdaKotlinCallArgument>()?.let lambda@{ lambda ->
|
||||
val parameterTypes = lambda.parametersTypes?.toList() ?: return@lambda
|
||||
val index = parameterTypes.indexOf(constraintError.upperType)
|
||||
val index = parameterTypes.indexOf(constraintError.upperKotlinType.unwrap())
|
||||
val lambdaExpression = lambda.psiExpression as? KtLambdaExpression ?: return@lambda
|
||||
val parameter = lambdaExpression.valueParameters.getOrNull(index) ?: return@lambda
|
||||
trace.report(Errors.EXPECTED_PARAMETER_TYPE_MISMATCH.on(parameter, constraintError.upperKotlinType.unCapture()))
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ open class EnumWhenLowering(protected val context: CommonBackendContext) : IrEle
|
||||
private val subjectWithOrdinalStack = mutableListOf<Pair<IrVariable, Lazy<IrVariable>>>()
|
||||
|
||||
protected open fun mapConstEnumEntry(entry: IrEnumEntry): Int =
|
||||
entry.parentAsClass.declarations.filterIsInstance<IrEnumEntry>().indexOf(this).also {
|
||||
entry.parentAsClass.declarations.filterIsInstance<IrEnumEntry>().indexOf(this as IrEnumEntry).also {
|
||||
assert(it >= 0) { "enum entry ${entry.dump()} not in parent class" }
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -427,7 +427,7 @@ class StateMachineBuilder(
|
||||
|
||||
private fun transformArguments(arguments: Array<IrExpression?>): Array<IrExpression?> {
|
||||
|
||||
var suspendableCount = arguments.fold(0) { r, n -> if (n in suspendableNodes) r + 1 else r }
|
||||
var suspendableCount = arguments.fold(0) { r, n -> if (n != null && n in suspendableNodes) r + 1 else r }
|
||||
|
||||
val newArguments = arrayOfNulls<IrExpression>(arguments.size)
|
||||
|
||||
|
||||
+5
-1
@@ -157,7 +157,11 @@ private class AdditionalClassAnnotationLowering(private val context: JvmBackendC
|
||||
private fun generateRetentionAnnotation(irClass: IrClass) {
|
||||
if (irClass.hasAnnotation(FqName("java.lang.annotation.Retention"))) return
|
||||
val kotlinRetentionPolicy = irClass.getAnnotation(FqName("kotlin.annotation.Retention"))
|
||||
val javaRetentionPolicy = annotationRetentionMap[kotlinRetentionPolicy] ?: rpRuntime
|
||||
val javaRetentionPolicy = if (kotlinRetentionPolicy is KotlinRetention) {
|
||||
annotationRetentionMap[kotlinRetentionPolicy] ?: rpRuntime
|
||||
} else {
|
||||
rpRuntime
|
||||
}
|
||||
|
||||
irClass.annotations.add(
|
||||
IrConstructorCallImpl.fromSymbolOwner(
|
||||
|
||||
+1
-1
@@ -62,7 +62,7 @@ internal class PropertyReferenceLowering(val context: JvmBackendContext) : Class
|
||||
get() = "${JvmAbi.getterName(name.asString())}()${context.state.typeMapper.mapReturnType(descriptor)}"
|
||||
|
||||
private val IrMemberAccessExpression.signature: String
|
||||
get() = localPropertyIndices[getter]?.let { "<v#$it>" } ?: getter?.owner?.signature ?: field!!.owner.signature
|
||||
get() = getter?.let { getter -> localPropertyIndices[getter]?.let { "<v#$it>" } } ?: getter?.owner?.signature ?: field!!.owner.signature
|
||||
|
||||
private val IrMemberAccessExpression.symbol: IrSymbol
|
||||
get() = getter?.owner?.symbol ?: field!!.owner.symbol
|
||||
|
||||
Reference in New Issue
Block a user