This can be reproduced by un-excluding the test_compiler_limits.kt file that's currently excluded for Kotlin/JS in https://github.com/streem/pbandk/blob/master/test-types/build.gradle.kts. The compiler will fail with a StackOverflowError and a stack trace similar to:
e: java.lang.StackOverflowError
at org.jetbrains.kotlin.ir.backend.js.utils.serialization.JsIrAstSerializer.writeExpression(JsIrAstSerializer.kt:783)
at org.jetbrains.kotlin.ir.backend.js.utils.serialization.JsIrAstSerializer.access$writeExpression(JsIrAstSerializer.kt:82)
at org.jetbrains.kotlin.ir.backend.js.utils.serialization.JsIrAstSerializer$writeExpression$visitor$1.visitBinaryExpression(JsIrAstSerializer.kt:478)
at org.jetbrains.kotlin.js.backend.ast.JsBinaryOperation.accept(JsBinaryOperation.java:47)
at org.jetbrains.kotlin.ir.backend.js.utils.serialization.JsIrAstSerializer.writeExpression(JsIrAstSerializer.kt:549)
at org.jetbrains.kotlin.ir.backend.js.utils.serialization.JsIrAstSerializer.access$writeExpression(JsIrAstSerializer.kt:82)
at org.jetbrains.kotlin.ir.backend.js.utils.serialization.JsIrAstSerializer$writeExpression$visitor$1.visitBinaryExpression(JsIrAstSerializer.kt:478)
at org.jetbrains.kotlin.js.backend.ast.JsBinaryOperation.accept(JsBinaryOperation.java:47)
...
I have not been able to narrow down which specific portion of the generated code is causing the stack overflow. But it seems to be related to the number of fields in MessageWithLotsOfFields.
This can be reproduced by un-excluding the
test_compiler_limits.ktfile that's currently excluded for Kotlin/JS in https://github.com/streem/pbandk/blob/master/test-types/build.gradle.kts. The compiler will fail with aStackOverflowErrorand a stack trace similar to:I have not been able to narrow down which specific portion of the generated code is causing the stack overflow. But it seems to be related to the number of fields in
MessageWithLotsOfFields.