K2: add bytecode listing tests
#KT-57171 Fixed
This commit is contained in:
@@ -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> {
|
||||
|
||||
Vendored
+3
@@ -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>
|
||||
|
||||
Vendored
+3
@@ -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>
|
||||
|
||||
compiler/testData/codegen/bytecodeListing/collectionStubs/abstractStubSignatures/genericStringMap.kt
Vendored
+3
@@ -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>
|
||||
|
||||
Vendored
+4
-1
@@ -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>
|
||||
|
||||
+4
-1
@@ -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>()
|
||||
|
||||
compiler/testData/codegen/bytecodeListing/collectionStubs/abstractStubSignatures/stringGenericMap.kt
Vendored
+3
@@ -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>
|
||||
|
||||
+4
-1
@@ -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
|
||||
|
||||
+4
-1
@@ -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
|
||||
|
||||
Vendored
+5
-1
@@ -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
|
||||
|
||||
+4
-1
@@ -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
|
||||
|
||||
Vendored
+4
-1
@@ -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
|
||||
|
||||
Vendored
+5
-1
@@ -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
|
||||
|
||||
+3
@@ -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>
|
||||
|
||||
+4
-1
@@ -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>
|
||||
|
||||
Vendored
+3
-1
@@ -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>()
|
||||
|
||||
|
||||
+7
-1
@@ -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>()
|
||||
|
||||
Vendored
+3
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
+4
-1
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
+4
-1
@@ -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>) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user