[K/N][K2] K2 behavioral difference with inconsistent inheritance of ObjCName

Support for complex cases with multiple substitution overrides.

#KT-64276 Fixed
This commit is contained in:
Anastasia.Nekrasova
2024-02-16 14:06:23 +02:00
committed by Space Team
parent d69240a2d5
commit fd4f6c90c7
5 changed files with 42 additions and 2 deletions
+21
View File
@@ -0,0 +1,21 @@
// FIR_IDENTICAL
// FILE: kotlin.kt
@file:OptIn(kotlin.experimental.ExperimentalObjCName::class)
fun interface AutoCloseable {
@ObjCName("close") fun close()
}
interface BaseStream<T, S : BaseStream<T, S>> : AutoCloseable {
override fun close()
}
interface Stream<T> : BaseStream<T, Stream<T>> {}
open class TerminatableStream<T : TerminatableStream<T>> {
@ObjCName("close") open fun close() {}
}
class StreamImpl<T> : TerminatableStream<StreamImpl<T>>, Stream<T> {
constructor() : super() {}
}