Kotlinc 2.4 language version update pre-work.

Fix impossible is checks that are guaranteed to always returns false.

PiperOrigin-RevId: 958436856
This commit is contained in:
Protobuf Team Bot 2026-08-03 10:06:33 -07:00 committed by Copybara-Service
parent 0e436a47e8
commit 0c9ba64990
3 changed files with 3 additions and 3 deletions

View file

@ -36,7 +36,7 @@ class DslListTest {
@Test
fun dslListIsNotMutable() {
val dslList = DslList<Int, DummyProxy>(mutableListOf(1, 2, 3))
assertThat(dslList is MutableList<*>).isFalse()
assertThat((dslList as Any) is MutableList<*>).isFalse()
}
@Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST")

View file

@ -35,7 +35,7 @@ class DslMapTest {
@Test
fun dslMapIsNotMutable() {
val dslMap = DslMap<Int, Int, DummyProxy>(mutableMapOf(1 to -1))
assertThat(dslMap is MutableMap<*, *>).isFalse()
assertThat((dslMap as Any) is MutableMap<*, *>).isFalse()
}
@Test

View file

@ -47,7 +47,7 @@ class ExtensionListTest {
TestProto.repeatedExtension,
mutableListOf(1, 2, 3),
)
assertThat(extensionList is MutableList<*>).isFalse()
assertThat((extensionList as Any) is MutableList<*>).isFalse()
}
@Suppress("PLATFORM_CLASS_MAPPED_TO_KOTLIN", "UNCHECKED_CAST")