From af2b77dd4e1f0fa5d93c6210ccdc8c52b010bdfe Mon Sep 17 00:00:00 2001 From: Alexander Udalov Date: Fri, 11 Nov 2022 12:53:37 +0100 Subject: [PATCH] FIR: minor, add message when value class has no representation KT-54897 --- .../src/org/jetbrains/kotlin/fir/backend/ConversionUtils.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/ConversionUtils.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/ConversionUtils.kt index ad867331f00..fb5c5e4fcfa 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/ConversionUtils.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/ConversionUtils.kt @@ -655,7 +655,9 @@ fun Fir2IrComponents.createTemporaryVariableForSafeCallConstruction( createTemporaryVariable(receiverExpression, conversionScope, "safe_receiver") fun Fir2IrComponents.computeValueClassRepresentation(klass: FirRegularClass): ValueClassRepresentation? { - require((klass.valueClassRepresentation != null) == klass.isInline) + require((klass.valueClassRepresentation != null) == klass.isInline) { + "Value class has no representation: ${klass.render()}" + } return klass.valueClassRepresentation?.mapUnderlyingType { with(typeConverter) { it.toIrType() as? IrSimpleType ?: error("Value class underlying type is not a simple type: ${klass.render()}")