JVM IR: Produce correct generic signatures for special bridge methods

This commit is contained in:
Steven Schäfer
2020-07-02 10:58:03 +02:00
committed by Alexander Udalov
parent c16b548dff
commit 9d63412b3e
12 changed files with 308 additions and 89 deletions
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
interface ImmutableCollection<out E> : Collection<E> {
fun add(element: @UnsafeVariance E): ImmutableCollection<E>
fun addAll(elements: Collection<@UnsafeVariance E>): ImmutableCollection<E>
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
open class A0<E> : MutableList<E> {
override fun add(element: E): Boolean {
throw UnsupportedOperationException()
@@ -1,4 +1,3 @@
// IGNORE_BACKEND: JVM_IR
// WITH_SIGNATURES
class GenericMap<K, V> : MutableMap<K, V> by HashMap<K, V>()
@@ -1,5 +1,5 @@
// IGNORE_BACKEND: JVM_IR
// WITH_SIGNATURES
// Test expectations differ between JVM and JVM IR backends, because of KT-40277. This should be revisited once KT-40277 is resolved.
class StringStringMap : MutableMap<String, String> by HashMap<String, String>()
@@ -0,0 +1,57 @@
@kotlin.Metadata
public abstract class<Ljava/lang/Object;Ljava/util/Map<Ljava/lang/String;Ljava/lang/String;>;Lkotlin/jvm/internal/markers/KMutableMap;> AbstractStringStringMap {
public @org.jetbrains.annotations.NotNull <()Ljava/util/Collection<Ljava/lang/String;>;> method getValues(): java.util.Collection
public bridge final <()Ljava/util/Collection<Ljava/lang/String;>;> method values(): java.util.Collection
public @org.jetbrains.annotations.NotNull <()Ljava/util/Set<Ljava/lang/String;>;> method getKeys(): java.util.Set
public bridge final <()Ljava/util/Set<Ljava/lang/String;>;> method keySet(): java.util.Set
public bridge final <()Ljava/util/Set<Ljava/util/Map$Entry<Ljava/lang/String;Ljava/lang/String;>;>;> method entrySet(): java.util.Set
public @org.jetbrains.annotations.NotNull <()Ljava/util/Set<Ljava/util/Map$Entry<Ljava/lang/String;Ljava/lang/String;>;>;> method getEntries(): java.util.Set
public <(Ljava/util/Map<+Ljava/lang/String;+Ljava/lang/String;>;)V> method putAll(@org.jetbrains.annotations.NotNull p0: java.util.Map): void
public <null> method <init>(): void
public <null> method clear(): void
public <null> method containsKey(@org.jetbrains.annotations.NotNull p0: java.lang.String): boolean
public bridge final <null> method containsKey(p0: java.lang.Object): boolean
public <null> method containsValue(@org.jetbrains.annotations.NotNull p0: java.lang.String): boolean
public bridge final <null> method containsValue(p0: java.lang.Object): boolean
public @org.jetbrains.annotations.Nullable <null> method get(@org.jetbrains.annotations.NotNull p0: java.lang.String): java.lang.String
public synthetic bridge <null> method get(p0: java.lang.Object): java.lang.Object
public bridge final <null> method get(p0: java.lang.Object): java.lang.String
public <null> method getSize(): int
public <null> method isEmpty(): boolean
public @org.jetbrains.annotations.Nullable <null> method put(@org.jetbrains.annotations.NotNull p0: java.lang.String, @org.jetbrains.annotations.NotNull p1: java.lang.String): java.lang.String
public synthetic bridge <null> method put(p0: java.lang.Object, p1: java.lang.Object): java.lang.Object
public @org.jetbrains.annotations.Nullable <null> method remove(@org.jetbrains.annotations.NotNull p0: java.lang.String): java.lang.String
public synthetic bridge <null> method remove(p0: java.lang.Object): java.lang.Object
public bridge final <null> method remove(p0: java.lang.Object): java.lang.String
public bridge final <null> method size(): int
private synthetic final field <Ljava/util/HashMap<Ljava/lang/String;Ljava/lang/String;>;> $$delegate_0: java.util.HashMap
}
@kotlin.Metadata
public final class<Ljava/lang/Object;Ljava/util/Map<Ljava/lang/String;Ljava/lang/String;>;Lkotlin/jvm/internal/markers/KMutableMap;> StringStringMap {
public @org.jetbrains.annotations.NotNull <()Ljava/util/Collection<Ljava/lang/String;>;> method getValues(): java.util.Collection
public bridge final <()Ljava/util/Collection<Ljava/lang/String;>;> method values(): java.util.Collection
public @org.jetbrains.annotations.NotNull <()Ljava/util/Set<Ljava/lang/String;>;> method getKeys(): java.util.Set
public bridge final <()Ljava/util/Set<Ljava/lang/String;>;> method keySet(): java.util.Set
public bridge final <()Ljava/util/Set<Ljava/util/Map$Entry<Ljava/lang/String;Ljava/lang/String;>;>;> method entrySet(): java.util.Set
public @org.jetbrains.annotations.NotNull <()Ljava/util/Set<Ljava/util/Map$Entry<Ljava/lang/String;Ljava/lang/String;>;>;> method getEntries(): java.util.Set
public <(Ljava/util/Map<+Ljava/lang/String;+Ljava/lang/String;>;)V> method putAll(@org.jetbrains.annotations.NotNull p0: java.util.Map): void
public <null> method <init>(): void
public <null> method clear(): void
public <null> method containsKey(@org.jetbrains.annotations.NotNull p0: java.lang.String): boolean
public bridge final <null> method containsKey(p0: java.lang.Object): boolean
public <null> method containsValue(@org.jetbrains.annotations.NotNull p0: java.lang.String): boolean
public bridge final <null> method containsValue(p0: java.lang.Object): boolean
public @org.jetbrains.annotations.Nullable <null> method get(@org.jetbrains.annotations.NotNull p0: java.lang.String): java.lang.String
public synthetic bridge <null> method get(p0: java.lang.Object): java.lang.Object
public bridge final <null> method get(p0: java.lang.Object): java.lang.String
public <null> method getSize(): int
public <null> method isEmpty(): boolean
public @org.jetbrains.annotations.Nullable <null> method put(@org.jetbrains.annotations.NotNull p0: java.lang.String, @org.jetbrains.annotations.NotNull p1: java.lang.String): java.lang.String
public synthetic bridge <null> method put(p0: java.lang.Object, p1: java.lang.Object): java.lang.Object
public @org.jetbrains.annotations.Nullable <null> method remove(@org.jetbrains.annotations.NotNull p0: java.lang.String): java.lang.String
public synthetic bridge <null> method remove(p0: java.lang.Object): java.lang.Object
public bridge final <null> method remove(p0: java.lang.Object): java.lang.String
public bridge final <null> method size(): int
private synthetic final field <Ljava/util/HashMap<Ljava/lang/String;Ljava/lang/String;>;> $$delegate_0: java.util.HashMap
}
@@ -1,5 +1,5 @@
// IGNORE_BACKEND: JVM_IR
// WITH_SIGNATURES
// Test expectations differ between JVM and JVM IR backends, because of KT-40277. This should be revisited once KT-40277 is resolved.
class StringMap<V> : MutableMap<String, V> by HashMap<String, V>()
@@ -0,0 +1,51 @@
@kotlin.Metadata
public abstract class<<V:Ljava/lang/Object;>Ljava/lang/Object;Ljava/util/Map<Ljava/lang/String;TV;>;Lkotlin/jvm/internal/markers/KMutableMap;> AbstractStringMap {
public @org.jetbrains.annotations.NotNull <()Ljava/util/Collection<TV;>;> method getValues(): java.util.Collection
public bridge final <()Ljava/util/Collection<TV;>;> method values(): java.util.Collection
public @org.jetbrains.annotations.NotNull <()Ljava/util/Set<Ljava/lang/String;>;> method getKeys(): java.util.Set
public bridge final <()Ljava/util/Set<Ljava/lang/String;>;> method keySet(): java.util.Set
public bridge final <()Ljava/util/Set<Ljava/util/Map$Entry<Ljava/lang/String;TV;>;>;> method entrySet(): java.util.Set
public @org.jetbrains.annotations.NotNull <()Ljava/util/Set<Ljava/util/Map$Entry<Ljava/lang/String;TV;>;>;> method getEntries(): java.util.Set
public @org.jetbrains.annotations.Nullable <(Ljava/lang/Object;)TV;> method get(@org.jetbrains.annotations.NotNull p0: java.lang.String): java.lang.Object
public bridge final <(Ljava/lang/Object;)TV;> method get(p0: java.lang.Object): java.lang.Object
public @org.jetbrains.annotations.Nullable <(Ljava/lang/Object;)TV;> method remove(@org.jetbrains.annotations.NotNull p0: java.lang.String): java.lang.Object
public bridge final <(Ljava/lang/Object;)TV;> method remove(p0: java.lang.Object): java.lang.Object
public @org.jetbrains.annotations.Nullable <(Ljava/lang/String;TV;)TV;> method put(@org.jetbrains.annotations.NotNull p0: java.lang.String, p1: java.lang.Object): java.lang.Object
public <(Ljava/util/Map<+Ljava/lang/String;+TV;>;)V> method putAll(@org.jetbrains.annotations.NotNull p0: java.util.Map): void
public <null> method <init>(): void
public <null> method clear(): void
public <null> method containsKey(@org.jetbrains.annotations.NotNull p0: java.lang.String): boolean
public bridge final <null> method containsKey(p0: java.lang.Object): boolean
public <null> method containsValue(p0: java.lang.Object): boolean
public <null> method getSize(): int
public <null> method isEmpty(): boolean
public synthetic bridge <null> method put(p0: java.lang.Object, p1: java.lang.Object): java.lang.Object
public bridge final <null> method size(): int
private synthetic final field <Ljava/util/HashMap<Ljava/lang/String;TV;>;> $$delegate_0: java.util.HashMap
}
@kotlin.Metadata
public final class<<V:Ljava/lang/Object;>Ljava/lang/Object;Ljava/util/Map<Ljava/lang/String;TV;>;Lkotlin/jvm/internal/markers/KMutableMap;> StringMap {
public @org.jetbrains.annotations.NotNull <()Ljava/util/Collection<TV;>;> method getValues(): java.util.Collection
public bridge final <()Ljava/util/Collection<TV;>;> method values(): java.util.Collection
public @org.jetbrains.annotations.NotNull <()Ljava/util/Set<Ljava/lang/String;>;> method getKeys(): java.util.Set
public bridge final <()Ljava/util/Set<Ljava/lang/String;>;> method keySet(): java.util.Set
public bridge final <()Ljava/util/Set<Ljava/util/Map$Entry<Ljava/lang/String;TV;>;>;> method entrySet(): java.util.Set
public @org.jetbrains.annotations.NotNull <()Ljava/util/Set<Ljava/util/Map$Entry<Ljava/lang/String;TV;>;>;> method getEntries(): java.util.Set
public @org.jetbrains.annotations.Nullable <(Ljava/lang/Object;)TV;> method get(@org.jetbrains.annotations.NotNull p0: java.lang.String): java.lang.Object
public bridge final <(Ljava/lang/Object;)TV;> method get(p0: java.lang.Object): java.lang.Object
public @org.jetbrains.annotations.Nullable <(Ljava/lang/Object;)TV;> method remove(@org.jetbrains.annotations.NotNull p0: java.lang.String): java.lang.Object
public bridge final <(Ljava/lang/Object;)TV;> method remove(p0: java.lang.Object): java.lang.Object
public @org.jetbrains.annotations.Nullable <(Ljava/lang/String;TV;)TV;> method put(@org.jetbrains.annotations.NotNull p0: java.lang.String, p1: java.lang.Object): java.lang.Object
public <(Ljava/util/Map<+Ljava/lang/String;+TV;>;)V> method putAll(@org.jetbrains.annotations.NotNull p0: java.util.Map): void
public <null> method <init>(): void
public <null> method clear(): void
public <null> method containsKey(@org.jetbrains.annotations.NotNull p0: java.lang.String): boolean
public bridge final <null> method containsKey(p0: java.lang.Object): boolean
public <null> method containsValue(p0: java.lang.Object): boolean
public <null> method getSize(): int
public <null> method isEmpty(): boolean
public synthetic bridge <null> method put(p0: java.lang.Object, p1: java.lang.Object): java.lang.Object
public bridge final <null> method size(): int
private synthetic final field <Ljava/util/HashMap<Ljava/lang/String;TV;>;> $$delegate_0: java.util.HashMap
}