FIR2IR: add comment about type parameter indexes

This commit is contained in:
Mikhail Glukhikh
2020-02-20 14:49:29 +03:00
parent 984a11995a
commit fb49a586ef
@@ -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 =