Add ABI tests for classes extending Number and CharSequence

This commit is contained in:
Dmitry Petrov
2020-10-09 16:36:35 +03:00
parent 6dd2d8bbdb
commit 91b8e32d43
11 changed files with 156 additions and 26 deletions
@@ -0,0 +1,9 @@
abstract class AbstractCharSequence : CharSequence
class MyCharSequence : CharSequence {
override val length: Int get() = 0
override fun get(index: Int): Char = throw Exception()
override fun subSequence(startIndex: Int, endIndex: Int): CharSequence = this
}
@@ -0,0 +1,20 @@
@kotlin.Metadata
public abstract class AbstractCharSequence {
// source: 'charSequence.kt'
public method <init>(): void
public bridge final method charAt(p0: int): char
public abstract method get(p0: int): char
public abstract method getLength(): int
public bridge final method length(): int
}
@kotlin.Metadata
public final class MyCharSequence {
// source: 'charSequence.kt'
public method <init>(): void
public bridge final method charAt(p0: int): char
public method get(p0: int): char
public method getLength(): int
public bridge final method length(): int
public @org.jetbrains.annotations.NotNull method subSequence(p0: int, p1: int): java.lang.CharSequence
}
@@ -0,0 +1,14 @@
// IGNORE_BACKEND: JVM_IR
// ^ see KT-42578
abstract class AbstractNumber : Number()
class MyNumber : Number() {
override fun toByte(): Byte = 0
override fun toChar(): Char = 0.toChar()
override fun toDouble(): Double = 0.0
override fun toFloat(): Float = 0.0f
override fun toInt(): Int = 0
override fun toLong(): Long = 0
override fun toShort(): Short = 0
}
@@ -0,0 +1,30 @@
@kotlin.Metadata
public abstract class AbstractNumber {
// source: 'number.kt'
public method <init>(): void
public bridge final method byteValue(): byte
public bridge final method doubleValue(): double
public bridge final method floatValue(): float
public bridge final method intValue(): int
public bridge final method longValue(): long
public bridge final method shortValue(): short
}
@kotlin.Metadata
public final class MyNumber {
// source: 'number.kt'
public method <init>(): void
public bridge final method byteValue(): byte
public bridge final method doubleValue(): double
public bridge final method floatValue(): float
public bridge final method intValue(): int
public bridge final method longValue(): long
public bridge final method shortValue(): short
public method toByte(): byte
public method toChar(): char
public method toDouble(): double
public method toFloat(): float
public method toInt(): int
public method toLong(): long
public method toShort(): short
}