diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/descriptors/SharedVariablesManager.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/descriptors/SharedVariablesManager.kt index 8c31b0d00ac..318025a34d6 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/descriptors/SharedVariablesManager.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/descriptors/SharedVariablesManager.kt @@ -93,7 +93,7 @@ class JvmSharedVariablesManager(val builtIns: KotlinBuiltIns) : SharedVariablesM fun getSubstitutedRefConstructor(valueType: KotlinType): ClassConstructorDescriptor = genericRefConstructor.substitute(TypeSubstitutor.create( mapOf(constructorTypeParameter.typeConstructor to TypeProjectionImpl(Variance.INVARIANT, valueType)) - )) + ))!! val genericElementField: PropertyDescriptor = PropertyDescriptorImpl.create( diff --git a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/EnumClassLowering.kt b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/EnumClassLowering.kt index 2c374496ea5..7c31aa8b1b1 100644 --- a/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/EnumClassLowering.kt +++ b/compiler/ir/backend.jvm/src/org/jetbrains/kotlin/backend/jvm/lower/EnumClassLowering.kt @@ -64,7 +64,7 @@ class EnumClassLowering(val context: JvmBackendContext) : ClassLoweringPass { private fun createArrayOfExpression(arrayElementType: KotlinType, arrayElements: List): IrExpression { val typeParameter0 = unsubstitutedArrayOfFun.typeParameters[0] val typeSubstitutor = TypeSubstitutor.create(mapOf(typeParameter0.typeConstructor to TypeProjectionImpl(arrayElementType))) - val substitutedArrayOfFun = unsubstitutedArrayOfFun.substitute(typeSubstitutor) + val substitutedArrayOfFun = unsubstitutedArrayOfFun.substitute(typeSubstitutor)!! val typeArguments = mapOf(typeParameter0 to arrayElementType) @@ -448,7 +448,7 @@ class EnumClassLowering(val context: JvmBackendContext) : ClassLoweringPass { val typeParameterT = unsubstitutedValueOf.typeParameters[0] val enumClassType = irClass.descriptor.defaultType val typeSubstitutor = TypeSubstitutor.create(mapOf(typeParameterT.typeConstructor to TypeProjectionImpl(enumClassType))) - val substitutedValueOf = unsubstitutedValueOf.substitute(typeSubstitutor) + val substitutedValueOf = unsubstitutedValueOf.substitute(typeSubstitutor)!! val irValueOfCall = IrCallImpl(UNDEFINED_OFFSET, UNDEFINED_OFFSET, substitutedValueOf, mapOf(typeParameterT to enumClassType)) irValueOfCall.putValueArgument(