Adjust testData to *Map transformation
This commit is contained in:
committed by
Mikhail Glukhikh
parent
6fa8083a70
commit
d71b0144d5
+6
-6
@@ -1,12 +1,12 @@
|
||||
class MyMap<K, V>: Map<K, V> {
|
||||
override val size: Int get() = 0
|
||||
override val isEmpty: Boolean get() = true
|
||||
override fun containsKey(key: Any?): Boolean = false
|
||||
override fun containsValue(value: Any?): Boolean = false
|
||||
override fun get(key: Any?): V? = null
|
||||
override fun keySet(): Set<K> = throw UnsupportedOperationException()
|
||||
override fun values(): Collection<V> = throw UnsupportedOperationException()
|
||||
override fun entrySet(): Set<Map.Entry<K, V>> = throw UnsupportedOperationException()
|
||||
override fun containsKey(key: K): Boolean = false
|
||||
override fun containsValue(value: V): Boolean = false
|
||||
override fun get(key: K): V? = null
|
||||
override val keys: Set<K> get() = throw UnsupportedOperationException()
|
||||
override val values: Collection<V> get() = throw UnsupportedOperationException()
|
||||
override val entries: Set<Map.Entry<K, V>> get() = throw UnsupportedOperationException()
|
||||
}
|
||||
|
||||
fun expectUoe(block: () -> Unit) {
|
||||
|
||||
+7
-7
@@ -1,15 +1,15 @@
|
||||
class MyMap<K, V>: Map<K, V> {
|
||||
override val size: Int get() = 0
|
||||
override val isEmpty: Boolean get() = true
|
||||
override fun containsKey(key: Any?): Boolean = false
|
||||
override fun containsValue(value: Any?): Boolean = false
|
||||
override fun get(key: Any?): V? = null
|
||||
override fun keySet(): Set<K> = throw UnsupportedOperationException()
|
||||
override fun values(): Collection<V> = throw UnsupportedOperationException()
|
||||
override fun entrySet(): Set<Map.Entry<K, V>> = throw UnsupportedOperationException()
|
||||
override fun containsKey(key: K): Boolean = false
|
||||
override fun containsValue(value: V): Boolean = false
|
||||
override fun get(key: K): V? = null
|
||||
override val keys: Set<K> get() = throw UnsupportedOperationException()
|
||||
override val values: Collection<V> get() = throw UnsupportedOperationException()
|
||||
override val entries: Set<Map.Entry<K, V>> get() = throw UnsupportedOperationException()
|
||||
|
||||
public fun put(key: K, value: V): V? = null
|
||||
public fun remove(key: Any?): V? = null
|
||||
public fun remove(key: K): V? = null
|
||||
public fun putAll(m: Map<out K, V>) {}
|
||||
public fun clear() {}
|
||||
}
|
||||
|
||||
+4
-4
@@ -2,7 +2,7 @@ import java.util.AbstractMap
|
||||
import java.util.Collections
|
||||
|
||||
class A : AbstractMap<Int, String>() {
|
||||
override fun entrySet(): MutableSet<MutableMap.MutableEntry<Int, String>> = Collections.emptySet()
|
||||
override val entries: MutableSet<MutableMap.MutableEntry<Int, String>> get() = Collections.emptySet()
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
@@ -14,9 +14,9 @@ fun box(): String {
|
||||
a.putAll(b)
|
||||
a.clear()
|
||||
|
||||
a.keySet()
|
||||
a.values()
|
||||
a.entrySet()
|
||||
a.keys
|
||||
a.values
|
||||
a.entries
|
||||
|
||||
return "OK"
|
||||
}
|
||||
|
||||
+3
-3
@@ -12,9 +12,9 @@ fun box(): String {
|
||||
a.putAll(b)
|
||||
a.clear()
|
||||
|
||||
a.keySet()
|
||||
a.values()
|
||||
a.entrySet()
|
||||
a.keys
|
||||
a.values
|
||||
a.entries
|
||||
|
||||
return "OK"
|
||||
}
|
||||
|
||||
@@ -5,27 +5,27 @@ class A : Map<String, String> {
|
||||
throw UnsupportedOperationException()
|
||||
}
|
||||
|
||||
override fun containsKey(key: Any?): Boolean {
|
||||
override fun containsKey(key: String): Boolean {
|
||||
throw UnsupportedOperationException()
|
||||
}
|
||||
|
||||
override fun containsValue(value: Any?): Boolean {
|
||||
override fun containsValue(value: String): Boolean {
|
||||
throw UnsupportedOperationException()
|
||||
}
|
||||
|
||||
override fun get(key: Any?): String? {
|
||||
override fun get(key: String): String? {
|
||||
throw UnsupportedOperationException()
|
||||
}
|
||||
|
||||
override fun keySet(): Set<String> {
|
||||
override val keys: Set<String> get() {
|
||||
throw UnsupportedOperationException()
|
||||
}
|
||||
|
||||
override fun values(): Collection<String> {
|
||||
override val values: Collection<String> get() {
|
||||
throw UnsupportedOperationException()
|
||||
}
|
||||
|
||||
override fun entrySet(): Set<Map.Entry<String, String>> {
|
||||
override val entries: Set<Map.Entry<String, String>> get() {
|
||||
throw UnsupportedOperationException()
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -39,8 +39,8 @@ fun box(): String {
|
||||
A.bar = baz + a.foo
|
||||
baz + A.bar
|
||||
|
||||
if (metadatas.keySet().size != 3)
|
||||
return "Fail: only three instances of PropertyMetadata should have been created\n${metadatas.keySet()}"
|
||||
if (metadatas.keys.size != 3)
|
||||
return "Fail: only three instances of PropertyMetadata should have been created\n${metadatas.keys}"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
|
||||
+1
-1
@@ -85,7 +85,7 @@ abstract class Tag(val name : String) : Element() {
|
||||
|
||||
private fun renderAttributes() : String? {
|
||||
val builder = StringBuilder()
|
||||
for (a in attributes.keySet()) {
|
||||
for (a in attributes.keys) {
|
||||
builder.append(" $a=\"${attributes[a]}\"")
|
||||
}
|
||||
return builder.toString()
|
||||
|
||||
@@ -92,19 +92,19 @@ fun <T> testMutableSet(s: MutableSet<T>, t: T) {
|
||||
}
|
||||
|
||||
fun <K, V> testMap(m: Map<K, V>) {
|
||||
val <!UNUSED_VARIABLE!>set<!>: Set<K> = m.keySet()
|
||||
val <!UNUSED_VARIABLE!>collection<!>: Collection<V> = m.values()
|
||||
val <!UNUSED_VARIABLE!>set1<!>: Set<Map.Entry<K, V>> = m.entrySet()
|
||||
val <!UNUSED_VARIABLE!>set<!>: Set<K> = m.keys
|
||||
val <!UNUSED_VARIABLE!>collection<!>: Collection<V> = m.values
|
||||
val <!UNUSED_VARIABLE!>set1<!>: Set<Map.Entry<K, V>> = m.entries
|
||||
|
||||
val <!UNUSED_VARIABLE!>mutableSet<!>: MutableSet<K> = <!TYPE_MISMATCH!>m.keySet()<!>
|
||||
val <!UNUSED_VARIABLE!>mutableCollection<!>: MutableCollection<V> = <!TYPE_MISMATCH!>m.values()<!>
|
||||
val <!UNUSED_VARIABLE!>mutableSet1<!>: MutableSet<MutableMap.MutableEntry<K, V>> = <!TYPE_MISMATCH!>m.entrySet()<!>
|
||||
val <!UNUSED_VARIABLE!>mutableSet<!>: MutableSet<K> = <!TYPE_MISMATCH!>m.keys<!>
|
||||
val <!UNUSED_VARIABLE!>mutableCollection<!>: MutableCollection<V> = <!TYPE_MISMATCH!>m.values<!>
|
||||
val <!UNUSED_VARIABLE!>mutableSet1<!>: MutableSet<MutableMap.MutableEntry<K, V>> = <!TYPE_MISMATCH!>m.entries<!>
|
||||
}
|
||||
|
||||
fun <K, V> testMutableMap(m: MutableMap<K, V>) {
|
||||
val <!UNUSED_VARIABLE!>mutableSet<!>: MutableSet<K> = m.keySet()
|
||||
val <!UNUSED_VARIABLE!>mutableCollection<!>: MutableCollection<V> = m.values()
|
||||
val <!UNUSED_VARIABLE!>mutableSet1<!>: MutableSet<MutableMap.MutableEntry<K, V>> = m.entrySet()
|
||||
val <!UNUSED_VARIABLE!>mutableSet<!>: MutableSet<K> = m.keys
|
||||
val <!UNUSED_VARIABLE!>mutableCollection<!>: MutableCollection<V> = m.values
|
||||
val <!UNUSED_VARIABLE!>mutableSet1<!>: MutableSet<MutableMap.MutableEntry<K, V>> = m.entries
|
||||
}
|
||||
|
||||
fun <T> array(vararg <!UNUSED_PARAMETER!>t<!>: T): Array<T> {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
|
||||
Vendored
+7
-7
@@ -4,24 +4,24 @@ public fun </*0*/ M2 : WithFoo> foo(/*0*/ delegateResolver: ResolverForProject<M
|
||||
|
||||
public/*package*/ open class MyMap</*0*/ K : kotlin.Any!, /*1*/ V : kotlin.Any!> : java.util.AbstractMap<K!, V!> {
|
||||
public/*package*/ constructor MyMap</*0*/ K : kotlin.Any!, /*1*/ V : kotlin.Any!>()
|
||||
public open override /*1*/ val entries: kotlin.MutableSet<kotlin.MutableMap.MutableEntry<K!, V!>>
|
||||
public open override /*1*/ /*fake_override*/ val isEmpty: kotlin.Boolean
|
||||
invisible_fake final override /*1*/ /*fake_override*/ var keySet: kotlin.(Mutable)Set<K!>!
|
||||
public open override /*1*/ /*fake_override*/ val keys: kotlin.MutableSet<K!>
|
||||
public open override /*1*/ /*fake_override*/ val size: kotlin.Int
|
||||
invisible_fake final override /*1*/ /*fake_override*/ var values: kotlin.(Mutable)Collection<V!>!
|
||||
public open override /*1*/ /*fake_override*/ val values: kotlin.MutableCollection<V!>
|
||||
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.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun containsValue(/*0*/ value: kotlin.Any?): kotlin.Boolean
|
||||
@java.lang.Override() public open override /*1*/ fun entrySet(): kotlin.MutableSet<kotlin.MutableMap.MutableEntry<K!, V!>>
|
||||
public open override /*1*/ /*fake_override*/ fun containsKey(/*0*/ key: K!): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun containsValue(/*0*/ value: V!): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun get(/*0*/ key: kotlin.Any?): V?
|
||||
public open override /*1*/ /*fake_override*/ fun get(/*0*/ key: K!): V?
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun keySet(): kotlin.MutableSet<K!>
|
||||
public open override /*1*/ /*fake_override*/ fun put(/*0*/ key: K!, /*1*/ value: V!): V?
|
||||
public open override /*1*/ /*fake_override*/ fun putAll(/*0*/ m: kotlin.Map<out K!, V!>): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun remove(/*0*/ key: kotlin.Any?): V?
|
||||
public open override /*1*/ /*fake_override*/ fun remove(/*0*/ key: K!): V?
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
public open override /*1*/ /*fake_override*/ fun values(): kotlin.MutableCollection<V!>
|
||||
|
||||
// Static members
|
||||
invisible_fake open override /*1*/ /*fake_override*/ fun eq(/*0*/ p0: kotlin.Any!, /*1*/ p1: kotlin.Any!): kotlin.Boolean
|
||||
|
||||
+13
-13
@@ -1,25 +1,27 @@
|
||||
package
|
||||
|
||||
public interface ExtMap</*0*/ K, /*1*/ V> : kotlin.Map<K, V> {
|
||||
public abstract override /*1*/ /*fake_override*/ val entries: kotlin.Set<kotlin.Map.Entry<K, V>>
|
||||
public abstract override /*1*/ /*fake_override*/ val isEmpty: kotlin.Boolean
|
||||
public abstract override /*1*/ /*fake_override*/ val keys: kotlin.Set<K>
|
||||
public abstract override /*1*/ /*fake_override*/ val size: kotlin.Int
|
||||
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*/ /*fake_override*/ fun entrySet(): kotlin.Set<kotlin.Map.Entry<K, V>>
|
||||
public abstract override /*1*/ /*fake_override*/ val values: kotlin.Collection<V>
|
||||
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 open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public abstract override /*1*/ /*fake_override*/ fun get(/*0*/ key: kotlin.Any?): V?
|
||||
public abstract override /*1*/ /*fake_override*/ fun get(/*0*/ key: K): V?
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public abstract override /*1*/ /*fake_override*/ fun keySet(): kotlin.Set<K>
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
public abstract override /*1*/ /*fake_override*/ fun values(): kotlin.Collection<V>
|
||||
}
|
||||
|
||||
public final class HashMapEx</*0*/ K, /*1*/ V> : java.util.HashMap<K, V>, ExtMap<K, V> {
|
||||
public constructor HashMapEx</*0*/ K, /*1*/ V>()
|
||||
public open override /*2*/ /*fake_override*/ val entries: kotlin.MutableSet<kotlin.MutableMap.MutableEntry<K, V>>
|
||||
invisible_fake final override /*1*/ /*fake_override*/ var entrySet: kotlin.(Mutable)Set<kotlin.(Mutable)Map.(Mutable)Entry<K!, V!>!>!
|
||||
invisible_fake final override /*1*/ /*fake_override*/ val hashSeed: kotlin.Int
|
||||
public open override /*2*/ /*fake_override*/ val isEmpty: kotlin.Boolean
|
||||
invisible_fake final override /*1*/ /*fake_override*/ var keySet: kotlin.(Mutable)Set<K!>!
|
||||
public open override /*2*/ /*fake_override*/ val keys: kotlin.MutableSet<K>
|
||||
invisible_fake final override /*1*/ /*fake_override*/ val loadFactor: kotlin.Float
|
||||
invisible_fake final override /*1*/ /*fake_override*/ var modCount: kotlin.Int
|
||||
invisible_fake final override /*1*/ /*fake_override*/ var size: kotlin.Int
|
||||
@@ -28,24 +30,23 @@ public final class HashMapEx</*0*/ K, /*1*/ V> : java.util.HashMap<K, V>, ExtMap
|
||||
invisible_fake final override /*1*/ /*fake_override*/ var threshold: kotlin.Int
|
||||
invisible_fake final override /*1*/ /*fake_override*/ var useAltHashing: kotlin.Boolean
|
||||
invisible_fake final override /*1*/ /*fake_override*/ var values: kotlin.(Mutable)Collection<V!>!
|
||||
public open override /*2*/ /*fake_override*/ val values: kotlin.MutableCollection<V>
|
||||
invisible_fake open override /*1*/ /*fake_override*/ fun addEntry(/*0*/ p0: kotlin.Int, /*1*/ p1: K!, /*2*/ p2: V!, /*3*/ p3: kotlin.Int): kotlin.Unit
|
||||
invisible_fake open override /*1*/ /*fake_override*/ fun capacity(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun clear(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun clone(): kotlin.Any
|
||||
public open override /*2*/ /*fake_override*/ fun containsKey(/*0*/ key: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*2*/ /*fake_override*/ fun containsKey(/*0*/ key: K): kotlin.Boolean
|
||||
invisible_fake open override /*1*/ /*fake_override*/ fun containsNullValue(): kotlin.Boolean
|
||||
public open override /*2*/ /*fake_override*/ fun containsValue(/*0*/ value: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*2*/ /*fake_override*/ fun containsValue(/*0*/ value: V): kotlin.Boolean
|
||||
invisible_fake open override /*1*/ /*fake_override*/ fun createEntry(/*0*/ p0: kotlin.Int, /*1*/ p1: K!, /*2*/ p2: V!, /*3*/ p3: kotlin.Int): kotlin.Unit
|
||||
public open override /*2*/ /*fake_override*/ fun entrySet(): kotlin.MutableSet<kotlin.MutableMap.MutableEntry<K, V>>
|
||||
invisible_fake open override /*1*/ /*fake_override*/ fun entrySet0(): kotlin.(Mutable)Set<kotlin.(Mutable)Map.(Mutable)Entry<K!, V!>!>!
|
||||
public open override /*2*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*2*/ /*fake_override*/ fun get(/*0*/ key: kotlin.Any?): V?
|
||||
public open override /*2*/ /*fake_override*/ fun get(/*0*/ key: K): V?
|
||||
invisible_fake final override /*1*/ /*fake_override*/ fun getEntry(/*0*/ p0: kotlin.Any!): java.util.HashMap.Entry<K!, V!>!
|
||||
invisible_fake open override /*1*/ /*fake_override*/ fun getForNullKey(): V!
|
||||
invisible_fake final override /*1*/ /*fake_override*/ fun hash(/*0*/ p0: kotlin.Any!): kotlin.Int
|
||||
public open override /*2*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
invisible_fake open override /*1*/ /*fake_override*/ fun init(): kotlin.Unit
|
||||
public open override /*2*/ /*fake_override*/ fun keySet(): kotlin.MutableSet<K>
|
||||
invisible_fake open override /*1*/ /*fake_override*/ fun loadFactor(): kotlin.Float
|
||||
invisible_fake open override /*1*/ /*fake_override*/ fun newEntryIterator(): kotlin.(Mutable)Iterator<kotlin.(Mutable)Map.(Mutable)Entry<K!, V!>!>!
|
||||
invisible_fake open override /*1*/ /*fake_override*/ fun newKeyIterator(): kotlin.(Mutable)Iterator<K!>!
|
||||
@@ -56,12 +57,11 @@ public final class HashMapEx</*0*/ K, /*1*/ V> : java.util.HashMap<K, V>, ExtMap
|
||||
invisible_fake open override /*1*/ /*fake_override*/ fun putForCreate(/*0*/ p0: K!, /*1*/ p1: V!): kotlin.Unit
|
||||
invisible_fake open override /*1*/ /*fake_override*/ fun putForNullKey(/*0*/ p0: V!): V!
|
||||
invisible_fake open override /*1*/ /*fake_override*/ fun readObject(/*0*/ p0: java.io.ObjectInputStream!): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun remove(/*0*/ key: kotlin.Any?): V?
|
||||
public open override /*1*/ /*fake_override*/ fun remove(/*0*/ key: K): V?
|
||||
invisible_fake final override /*1*/ /*fake_override*/ fun removeEntryForKey(/*0*/ p0: kotlin.Any!): java.util.HashMap.Entry<K!, V!>!
|
||||
invisible_fake final override /*1*/ /*fake_override*/ fun removeMapping(/*0*/ p0: kotlin.Any!): java.util.HashMap.Entry<K!, V!>!
|
||||
invisible_fake open override /*1*/ /*fake_override*/ fun resize(/*0*/ p0: kotlin.Int): kotlin.Unit
|
||||
public open override /*2*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
invisible_fake open override /*1*/ /*fake_override*/ fun transfer(/*0*/ p0: kotlin.Array<(out) java.util.HashMap.Entry<(raw) kotlin.Any!, (raw) kotlin.Any!>!>!, /*1*/ p1: kotlin.Boolean): kotlin.Unit
|
||||
public open override /*2*/ /*fake_override*/ fun values(): kotlin.MutableCollection<V>
|
||||
invisible_fake open override /*1*/ /*fake_override*/ fun writeObject(/*0*/ p0: java.io.ObjectOutputStream!): kotlin.Unit
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
||||
// WITH_RUNTIME
|
||||
// PARAM_TYPES: Foo<T>
|
||||
// PARAM_TYPES: kotlin.String, Comparable<String>, CharSequence, java.io.Serializable, kotlin.Any
|
||||
// PARAM_TYPES: kotlin.String
|
||||
// PARAM_DESCRIPTOR: internal final class Foo<T> defined in root package
|
||||
// PARAM_DESCRIPTOR: value-parameter val l: kotlin.String defined in Foo.test
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
// WITH_RUNTIME
|
||||
// PARAM_TYPES: Foo<T>
|
||||
// PARAM_TYPES: kotlin.String, Comparable<String>, CharSequence, java.io.Serializable, kotlin.Any
|
||||
// PARAM_TYPES: kotlin.String
|
||||
// PARAM_DESCRIPTOR: internal final class Foo<T> defined in root package
|
||||
// PARAM_DESCRIPTOR: value-parameter val l: kotlin.String defined in Foo.test
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -1,5 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
// PARAM_TYPES: kotlin.String, Comparable<String>, CharSequence, java.io.Serializable, kotlin.Any
|
||||
// PARAM_TYPES: kotlin.String
|
||||
// PARAM_DESCRIPTOR: value-parameter val l: kotlin.String defined in Foo.test
|
||||
|
||||
import java.util.*
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
// WITH_RUNTIME
|
||||
// PARAM_TYPES: kotlin.String, Comparable<String>, CharSequence, java.io.Serializable, kotlin.Any
|
||||
// PARAM_TYPES: kotlin.String
|
||||
// PARAM_DESCRIPTOR: value-parameter val l: kotlin.String defined in Foo.test
|
||||
|
||||
import java.util.*
|
||||
|
||||
Reference in New Issue
Block a user