JVM IR: Restore logic of finding line number for suspend lambda

Before c7bc439661 we did not throw
exception when we could not find line number for element. However,
on synthetic suspend lambdas we do not have line numbers.

If future, when we fix adapted callable references (see KT-55559)
there will be more of them.

 #KT-56910 Fixed
This commit is contained in:
Ilmir Usmanov
2023-03-01 16:55:15 +01:00
committed by Space Team
parent 3eddfeb8c9
commit 010c7acc3a
@@ -45,7 +45,7 @@ internal fun MethodNode.acceptWithStateMachine(
if (klass.startOffset >= 0) {
// if it suspend lambda transformed into class `runSuspend { .... }`
irFunction.file.fileEntry.getLineNumber(klass.startOffset) + 1
} else error("Cannot determine lineNumber of element ${irFunction.render()}")
} else 1 // This lambda might be synthetic
}
val visitor = CoroutineTransformerMethodVisitor(