Files
kotlin/compiler/testData/codegen/bytecodeText/builtinFunctions/genericParameterBridge/mutableSetInterfaces.kt
Denis Zharkov fa99ea1e98 Generate type-safe barrier in method body
In cases when signature of special bridge is the same as current method,
but type is not 'Any?'.

Also there is tiny optimization:
only null check needed if value parameter type is mapped to Object,
but it's not nullable.

 #KT-9973 Fixed
2015-11-17 16:27:02 +03:00

29 lines
790 B
Kotlin
Vendored

interface I1<R> : MutableSet<R> {
override fun contains(o: R): Boolean {
throw UnsupportedOperationException()
}
override fun containsAll(c: Collection<R>): Boolean {
throw UnsupportedOperationException()
}
}
interface I2 : MutableSet<String> {
override fun contains(o: String): Boolean {
throw UnsupportedOperationException()
}
override fun containsAll(c: Collection<String>): Boolean {
throw UnsupportedOperationException()
}
}
abstract class A : I2
// 1 public final bridge contains\(Ljava/lang/Object;\)Z
// 1 public final bridge remove\(Ljava/lang/Object;\)Z
/* 2 INSTANCEOF: one for 'remove', one for 'contains' type-safe bridges of A
There should be no bridges in interfaces
*/
// 2 INSTANCEOF java/lang/String