From fb49a586efdbfecc0d90070022448e09632c913b Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Thu, 20 Feb 2020 14:49:29 +0300 Subject: [PATCH] FIR2IR: add comment about type parameter indexes --- .../jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt index ab65198637e..874780ad25f 100644 --- a/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt +++ b/compiler/fir/fir2ir/src/org/jetbrains/kotlin/fir/backend/Fir2IrDeclarationStorage.kt @@ -322,8 +322,13 @@ class Fir2IrDeclarationStorage( }.declareSupertypesAndTypeParameters(anonymousObject) } + // TODO: change index default to -1 private fun getIrTypeParameter(typeParameter: FirTypeParameter, index: Int = 0): IrTypeParameter { return typeParameterCache[typeParameter] ?: typeParameter.run { + // Yet I don't want to enable this requirement because it breaks some tests + // However, if we get here it *should* mean that type parameter index is given explicitly + // At this moment (20.02.2020) this requirement breaks 11/355 Fir2IrText tests + // require(index != -1) val descriptor = WrappedTypeParameterDescriptor() val origin = IrDeclarationOrigin.DEFINED val irTypeParameter =