Transform builtin Map declaration and adjust stdlib
This commit is contained in:
committed by
Mikhail Glukhikh
parent
f0e3fd617d
commit
6fa8083a70
+19
-13
@@ -928,16 +928,19 @@ public final class LongRange : kotlin.Range<kotlin.Long>, kotlin.Progression<kot
|
||||
}
|
||||
|
||||
public interface Map</*0*/ K, /*1*/ out V> {
|
||||
public abstract val entries: kotlin.Set<kotlin.Map.Entry<K, V>>
|
||||
public abstract fun <get-entries>(): kotlin.Set<kotlin.Map.Entry<K, V>>
|
||||
public abstract val isEmpty: kotlin.Boolean
|
||||
public abstract fun <get-isEmpty>(): kotlin.Boolean
|
||||
public abstract val keys: kotlin.Set<K>
|
||||
public abstract fun <get-keys>(): kotlin.Set<K>
|
||||
public abstract val size: kotlin.Int
|
||||
public abstract fun <get-size>(): kotlin.Int
|
||||
public abstract fun containsKey(/*0*/ key: kotlin.Any?): kotlin.Boolean
|
||||
public abstract fun containsValue(/*0*/ value: kotlin.Any?): kotlin.Boolean
|
||||
public abstract fun entrySet(): kotlin.Set<kotlin.Map.Entry<K, V>>
|
||||
public abstract operator fun get(/*0*/ key: kotlin.Any?): V?
|
||||
public abstract fun keySet(): kotlin.Set<K>
|
||||
public abstract fun values(): kotlin.Collection<V>
|
||||
public abstract val values: kotlin.Collection<V>
|
||||
public abstract fun <get-values>(): kotlin.Collection<V>
|
||||
public abstract fun containsKey(/*0*/ key: K): kotlin.Boolean
|
||||
public abstract fun containsValue(/*0*/ value: @kotlin.UnsafeVariance() V): kotlin.Boolean
|
||||
public abstract operator fun get(/*0*/ key: K): V?
|
||||
|
||||
public interface Entry</*0*/ out K, /*1*/ out V> {
|
||||
public abstract val key: K
|
||||
@@ -1012,20 +1015,23 @@ public interface MutableListIterator</*0*/ T> : kotlin.ListIterator<T>, kotlin.M
|
||||
}
|
||||
|
||||
public interface MutableMap</*0*/ K, /*1*/ V> : kotlin.Map<K, V> {
|
||||
public abstract override /*1*/ val entries: kotlin.MutableSet<kotlin.MutableMap.MutableEntry<K, V>>
|
||||
public abstract override /*1*/ fun <get-entries>(): kotlin.MutableSet<kotlin.MutableMap.MutableEntry<K, V>>
|
||||
public abstract override /*1*/ /*fake_override*/ val isEmpty: kotlin.Boolean
|
||||
public abstract override /*1*/ /*fake_override*/ fun <get-isEmpty>(): kotlin.Boolean
|
||||
public abstract override /*1*/ val keys: kotlin.MutableSet<K>
|
||||
public abstract override /*1*/ fun <get-keys>(): kotlin.MutableSet<K>
|
||||
public abstract override /*1*/ /*fake_override*/ val size: kotlin.Int
|
||||
public abstract override /*1*/ /*fake_override*/ fun <get-size>(): kotlin.Int
|
||||
public abstract override /*1*/ val values: kotlin.MutableCollection<V>
|
||||
public abstract override /*1*/ fun <get-values>(): kotlin.MutableCollection<V>
|
||||
public abstract fun clear(): kotlin.Unit
|
||||
public abstract override /*1*/ /*fake_override*/ fun containsKey(/*0*/ key: kotlin.Any?): kotlin.Boolean
|
||||
public abstract override /*1*/ /*fake_override*/ fun containsValue(/*0*/ value: kotlin.Any?): kotlin.Boolean
|
||||
public abstract override /*1*/ fun entrySet(): kotlin.MutableSet<kotlin.MutableMap.MutableEntry<K, V>>
|
||||
public abstract override /*1*/ /*fake_override*/ fun get(/*0*/ key: kotlin.Any?): V?
|
||||
public abstract override /*1*/ fun keySet(): kotlin.MutableSet<K>
|
||||
public abstract override /*1*/ /*fake_override*/ fun containsKey(/*0*/ key: K): kotlin.Boolean
|
||||
public abstract override /*1*/ /*fake_override*/ fun containsValue(/*0*/ value: V): kotlin.Boolean
|
||||
public abstract override /*1*/ /*fake_override*/ fun get(/*0*/ key: K): V?
|
||||
public abstract fun put(/*0*/ key: K, /*1*/ value: V): V?
|
||||
public abstract fun putAll(/*0*/ m: kotlin.Map<out K, V>): kotlin.Unit
|
||||
public abstract fun remove(/*0*/ key: kotlin.Any?): V?
|
||||
public abstract override /*1*/ fun values(): kotlin.MutableCollection<V>
|
||||
public abstract fun remove(/*0*/ key: K): V?
|
||||
|
||||
public interface MutableEntry</*0*/ K, /*1*/ V> : kotlin.Map.Entry<K, V> {
|
||||
public abstract override /*1*/ /*fake_override*/ val key: K
|
||||
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
// !DIAGNOSTICS: -UNUSED_VALUE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE
|
||||
// FILE: MyMap.java
|
||||
|
||||
abstract public class MyMap extends java.util.AbstractMap<Double, CharSequence> {
|
||||
String get(Object q) { }
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
|
||||
fun foo(m: MyMap) {
|
||||
var x: String? = m.get(1.0)
|
||||
x = m[2.0]
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
package
|
||||
|
||||
public fun foo(/*0*/ m: MyMap): kotlin.Unit
|
||||
|
||||
public abstract class MyMap : java.util.AbstractMap<kotlin.Double!, kotlin.CharSequence!> {
|
||||
public constructor MyMap()
|
||||
public abstract override /*1*/ /*fake_override*/ val entries: kotlin.MutableSet<kotlin.MutableMap.MutableEntry<kotlin.Double!, kotlin.CharSequence!>>
|
||||
public open override /*1*/ /*fake_override*/ val isEmpty: kotlin.Boolean
|
||||
invisible_fake final override /*1*/ /*fake_override*/ var keySet: kotlin.(Mutable)Set<kotlin.Double!>!
|
||||
public open override /*1*/ /*fake_override*/ val keys: kotlin.MutableSet<kotlin.Double!>
|
||||
public open override /*1*/ /*fake_override*/ val size: kotlin.Int
|
||||
invisible_fake final override /*1*/ /*fake_override*/ var values: kotlin.(Mutable)Collection<kotlin.CharSequence!>!
|
||||
public open override /*1*/ /*fake_override*/ val values: kotlin.MutableCollection<kotlin.CharSequence!>
|
||||
public open override /*1*/ /*fake_override*/ fun clear(): kotlin.Unit
|
||||
protected/*protected and package*/ open override /*1*/ /*fake_override*/ fun clone(): kotlin.Any!
|
||||
public open override /*1*/ /*fake_override*/ fun containsKey(/*0*/ key: kotlin.Double!): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun containsValue(/*0*/ value: kotlin.CharSequence!): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public/*package*/ open override /*1*/ /*synthesized*/ fun get(/*0*/ q: kotlin.Double!): kotlin.String?
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun put(/*0*/ key: kotlin.Double!, /*1*/ value: kotlin.CharSequence!): kotlin.CharSequence?
|
||||
public open override /*1*/ /*fake_override*/ fun putAll(/*0*/ m: kotlin.Map<out kotlin.Double!, kotlin.CharSequence!>): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun remove(/*0*/ key: kotlin.Double!): kotlin.CharSequence?
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
|
||||
// Static members
|
||||
invisible_fake open override /*1*/ /*fake_override*/ fun eq(/*0*/ p0: kotlin.Any!, /*1*/ p1: kotlin.Any!): kotlin.Boolean
|
||||
}
|
||||
@@ -9185,6 +9185,12 @@ public class JetDiagnosticsTestGenerated extends AbstractJetDiagnosticsTest {
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("mapGetOverride.kt")
|
||||
public void testMapGetOverride() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/j+k/collectionOverrides/mapGetOverride.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("removeAt.kt")
|
||||
public void testRemoveAt() throws Exception {
|
||||
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/j+k/collectionOverrides/removeAt.kt");
|
||||
|
||||
Reference in New Issue
Block a user