rules_kotlin
rules_kotlin copied to clipboard
[Bug report][Example] Kolitn 1.5.10 compilation issue on `private typealias`
Background
We found a regression on bazel kotlin rule where private typealias cannot be compiled correctly. This is the PR to repro the issue.
Repro Steps
cd examples/android; bazelisk build //libAndroid:Test
==========error message===========
exception: org.jetbrains.kotlin.backend.common.BackendException: Backend Internal error: Exception during IR lowering
File being compiled: /private/var/tmp/_bazel_jchen/804281e1574486d23f35a1e94292b21a/execroot/android_example/libAndroid/src/test/kotlin/examples/android/lib2/TestDataTest.kt
The root cause java.lang.AssertionError was thrown at: org.jetbrains.kotlin.ir.util.TypeTranslator.toIrTypeAbbreviation(TypeTranslator.kt:167)
at org.jetbrains.kotlin.backend.common.CodegenUtil.reportBackendException(CodegenUtil.kt:239)
at org.jetbrains.kotlin.backend.common.CodegenUtil.reportBackendException$default(CodegenUtil.kt:235)
at org.jetbrains.kotlin.backend.common.phaser.PerformByIrFilePhase.invoke(PhaseBuilders.kt:124)
Test on kotlin 1.4
If we keep the change on examples/android/bzl/BUILD.bazel to be 1.4 and don't bump up kotlin version. This issue will not happen, which proves that this is a regression on kotlin 1.5.10.
Test on jvm rules Jvm rules works correctly with the same test case. According to that, it's most likely an issue in android rules.
bazelisk build //projects/core/impl:Test
pass