K2: add bytecode listing tests

#KT-57171 Fixed
This commit is contained in:
Alexander Udalov
2023-03-10 00:18:25 +01:00
parent f8deae4570
commit f0fba7be64
59 changed files with 5423 additions and 55 deletions
@@ -1,6 +1,9 @@
// WITH_STDLIB
// FULL_JDK
// IGNORE_BACKEND_K2: JVM_IR
// FIR status: KT-57269 K2: collection stub for `sort` is not generated for custom List subclasses
import java.util.*
class ListSet<out E : Any> : List<E>, Set<E> {
@@ -1,3 +1,6 @@
// WITH_SIGNATURES
// IGNORE_BACKEND_K2: JVM_IR
// FIR status: KT-57268 K2: extra methods `remove` and/or `getOrDefault` are generated for Map subclasses with JDK 1.6 in dependencies
abstract class ByteShortMap : Map<Byte, Short>
@@ -1,3 +1,6 @@
// WITH_SIGNATURES
// IGNORE_BACKEND_K2: JVM_IR
// FIR status: KT-57268 K2: extra methods `remove` and/or `getOrDefault` are generated for Map subclasses with JDK 1.6 in dependencies
abstract class GenericMap<K, V> : Map<K, V>
@@ -1,3 +1,6 @@
// WITH_SIGNATURES
// IGNORE_BACKEND_K2: JVM_IR
// FIR status: KT-57268 K2: extra methods `remove` and/or `getOrDefault` are generated for Map subclasses with JDK 1.6 in dependencies
abstract class GenericStringMap<K> : Map<K, String>
@@ -1,3 +1,6 @@
// WITH_SIGNATURES
abstract class NumberStringMap : Map<Number, String>
// IGNORE_BACKEND_K2: JVM_IR
// FIR status: KT-57268 K2: extra methods `remove` and/or `getOrDefault` are generated for Map subclasses with JDK 1.6 in dependencies
abstract class NumberStringMap : Map<Number, String>
@@ -1,5 +1,8 @@
// WITH_SIGNATURES
// IGNORE_BACKEND_K2: JVM_IR
// FIR status: KT-57268 K2: extra methods `remove` and/or `getOrDefault` are generated for Map subclasses with JDK 1.6 in dependencies
abstract class GenericMap<K, V> : Map<K, V>
abstract class NumberStringMap : GenericMap<Number, String>()
abstract class NumberStringMap : GenericMap<Number, String>()
@@ -1,3 +1,6 @@
// WITH_SIGNATURES
// IGNORE_BACKEND_K2: JVM_IR
// FIR status: KT-57268 K2: extra methods `remove` and/or `getOrDefault` are generated for Map subclasses with JDK 1.6 in dependencies
abstract class StringGenericMap<V> : Map<String, V>
@@ -1,3 +1,6 @@
// IGNORE_BACKEND_K2: JVM_IR
// FIR status: KT-57268 K2: extra methods `remove` and/or `getOrDefault` are generated for Map subclasses with JDK 1.6 in dependencies
class DGenericIterator<T>(d: Iterator<T>) : Iterator<T> by d
class DGenericListIterator<T>(d: ListIterator<T>) : ListIterator<T> by d
@@ -16,4 +19,4 @@ class DGenericMapEntry<K, V>(d: Map.Entry<K, V>) : Map.Entry<K, V> by d
class DGenericCollectionBySet<T>(d: Set<T>) : Collection<T> by d
class DGenericCollectionByList<T>(d: List<T>) : Collection<T> by d
class DGenericCollectionByList<T>(d: List<T>) : Collection<T> by d
@@ -1,3 +1,6 @@
// IGNORE_BACKEND_K2: JVM_IR
// FIR status: KT-57268 K2: extra methods `remove` and/or `getOrDefault` are generated for Map subclasses with JDK 1.6 in dependencies
class DStringIterator(d: Iterator<String>) : Iterator<String> by d
class DStringListIterator(d: ListIterator<String>) : ListIterator<String> by d
@@ -16,4 +19,4 @@ class DStringMapEntry(d: Map.Entry<String, Number>) : Map.Entry<String, Number>
class DStringCollectionBySet(d: Set<String>) : Collection<String> by d
class DStringCollectionByList(d: List<String>) : Collection<String> by d
class DStringCollectionByList(d: List<String>) : Collection<String> by d
@@ -1,4 +1,8 @@
// FULL_JDK
// IGNORE_BACKEND_K2: JVM_IR
// FIR status: KT-57269 K2: collection stub for `sort` is not generated for custom List subclasses
class DStringIterator(d: Iterator<String>) : Iterator<String> by d
class DStringListIterator(d: ListIterator<String>) : ListIterator<String> by d
@@ -17,4 +21,4 @@ class DStringMapEntry(d: Map.Entry<String, Number>) : Map.Entry<String, Number>
class DStringCollectionBySet(d: Set<String>) : Collection<String> by d
class DStringCollectionByList(d: List<String>) : Collection<String> by d
class DStringCollectionByList(d: List<String>) : Collection<String> by d
@@ -1,3 +1,6 @@
// IGNORE_BACKEND_K2: JVM_IR
// FIR status: KT-57268 K2: extra methods `remove` and/or `getOrDefault` are generated for Map subclasses with JDK 1.6 in dependencies
class DIntIterator(d: Iterator<Int>) : Iterator<Int> by d
class DIntListIterator(d: ListIterator<Int>) : ListIterator<Int> by d
@@ -16,4 +19,4 @@ class DIntMapEntry(d: Map.Entry<Int, Double>) : Map.Entry<Int, Double> by d
class DIntCollectionBySet(d: Set<Int>) : Collection<Int> by d
class DIntCollectionByList(d: List<Int>) : Collection<Int> by d
class DIntCollectionByList(d: List<Int>) : Collection<Int> by d
@@ -1,6 +1,9 @@
// FULL_JDK
// See also: https://youtrack.jetbrains.com/issue/KT-42330
// IGNORE_BACKEND_K2: JVM_IR
// FIR status: KT-57269 K2: collection stub for `sort` is not generated for custom List subclasses
class DIntIterator(d: Iterator<Int>) : Iterator<Int> by d
class DIntListIterator(d: ListIterator<Int>) : ListIterator<Int> by d
@@ -19,4 +22,4 @@ class DIntMapEntry(d: Map.Entry<Int, Double>) : Map.Entry<Int, Double> by d
class DIntCollectionBySet(d: Set<Int>) : Collection<Int> by d
class DIntCollectionByList(d: List<Int>) : Collection<Int> by d
class DIntCollectionByList(d: List<Int>) : Collection<Int> by d
@@ -1,4 +1,8 @@
// FULL_JDK
// IGNORE_BACKEND_K2: JVM_IR
// FIR status: KT-57269 K2: collection stub for `sort` is not generated for custom List subclasses
class DGenericIterator<T>(d: Iterator<T>) : Iterator<T> by d
class DGenericListIterator<T>(d: ListIterator<T>) : ListIterator<T> by d
@@ -17,4 +21,4 @@ class DGenericMapEntry<K, V>(d: Map.Entry<K, V>) : Map.Entry<K, V> by d
class DGenericCollectionBySet<T>(d: Set<T>) : Collection<T> by d
class DGenericCollectionByList<T>(d: List<T>) : Collection<T> by d
class DGenericCollectionByList<T>(d: List<T>) : Collection<T> by d
@@ -1,6 +1,9 @@
// FULL_JDK
// See: KT-42114, KT-42115
// IGNORE_BACKEND_K2: JVM_IR
// FIR status: KT-57269 K2: collection stub for `sort` is not generated for custom List subclasses
abstract class AbstractIterator : Iterator<String>
abstract class AbstractIterable : Iterable<String>
@@ -1,3 +1,6 @@
// IGNORE_BACKEND_K2: JVM_IR
// FIR status: KT-57299 K2: VerifyError due to overriding final method `size` on a subclass of Collection and Set
abstract class AC<X> : Collection<X>
abstract class ASet<T> : AC<T>(), Set<T>
abstract class ASet<T> : AC<T>(), Set<T>
@@ -1,5 +1,8 @@
// WITH_STDLIB
// IGNORE_BACKEND_K2: JVM_IR
// FIR status: KT-57300 K2: subclass of MutableCollection with primitive element type has methods with boxed type
abstract class AIterD : AbstractIterator<Double>()
abstract class ACollD : AbstractCollection<Double>()
@@ -11,4 +14,3 @@ abstract class ASetD : AbstractSet<Double>()
abstract class AMSetD : AbstractMutableSet<Double>()
abstract class AListD : AbstractList<Double>()
@@ -1,5 +1,11 @@
// WITH_STDLIB
// IGNORE_BACKEND_K2: JVM_IR
// FIR status:
// 1) KT-57268 K2: extra methods `remove` and/or `getOrDefault` are generated for Map subclasses with JDK 1.6 in dependencies
// 2) KT-57300 K2: subclass of MutableCollection with primitive element type has methods with boxed type
// (`containsValue(Ljava/lang/Double;)Z` instead of `containsValue(D)Z`)
abstract class AMapSD : AbstractMap<String, Double>()
abstract class AMMapSD : AbstractMutableMap<String, Double>()
abstract class AMMapSD : AbstractMutableMap<String, Double>()
@@ -1,5 +1,8 @@
// WITH_STDLIB
// IGNORE_BACKEND_K2: JVM_IR
// FIR status: KT-57300 K2: subclass of MutableCollection with primitive element type has methods with boxed type
abstract class AMListD : AbstractMutableList<Double>()
abstract class AMListI : AbstractMutableList<Int>()
@@ -1,4 +1,3 @@
// IGNORE_BACKEND_K2: JVM_IR
// FULL_JDK
import java.util.concurrent.*
@@ -11,4 +10,4 @@ class Test1 : Iterable<String> {
class Test2 : Iterable<String> {
private val received = Array<String>(0) { "" }
override fun iterator() = received.iterator()
}
}
@@ -1,6 +1,9 @@
// Ensure the proper collection stubs are added, in
// particular *not* when specialized implementations are provided.
// IGNORE_BACKEND_K2: JVM_IR
// FIR status: KT-57268 K2: extra methods `remove` and/or `getOrDefault` are generated for Map subclasses with JDK 1.6 in dependencies
class MyMap<K, V> : Map<K, V> {
class MySet<E> : Set<E> {
@@ -20,4 +23,4 @@ class MyMap<K, V> : Map<K, V> {
override fun containsValue(value: V): Boolean = TODO()
override fun get(key: K): V = TODO()
override fun isEmpty(): Boolean = TODO()
}
}
@@ -1,5 +1,8 @@
// See KT-42033
// IGNORE_BACKEND_K2: JVM_IR
// FIR status: KT-57268 K2: extra methods `remove` and/or `getOrDefault` are generated for Map subclasses with JDK 1.6 in dependencies
interface ObservableMap<K, V> : Map<K, V>
abstract class ObservableMutableMap<K, V> : ObservableMap<K, V> {
@@ -9,4 +12,4 @@ abstract class ObservableMutableMap<K, V> : ObservableMap<K, V> {
fun putAll(from: Map<out K, V>) {
}
}
}