Ignore type parameters in value arguments while comparing SAM adapters

#KT-8388 Fixed
This commit is contained in:
Denis Zharkov
2015-07-10 08:46:27 +03:00
parent aa34fe6352
commit 76648878e0
11 changed files with 244 additions and 5 deletions
@@ -0,0 +1,22 @@
// FILE: MyFunc.java
public interface MyFunc<K, V> {
V apply(K String);
}
// FILE: ConcMap.java
public interface ConcMap<K, V> {
V computeIfAbsent(K key, MyFunc<? super K,? extends V> mappingFunction);
}
// FILE: ConcHashMap.java
public class ConcHashMap<K, V> implements ConcMap<K, V> {
@Override
V computeIfAbsent(K key, MyFunc<? super K,? extends V> mappingFunction) { }
}
// FILE: main.kt
public fun concurrentMap() {
val map = ConcHashMap<String, String>()
map.computeIfAbsent("") { "" } // here
}