Ignore type parameters in value arguments while comparing SAM adapters
#KT-8388 Fixed
This commit is contained in:
@@ -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
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package
|
||||
|
||||
public /*synthesized*/ fun </*0*/ K, /*1*/ V> ConcMap(/*0*/ function: (K!, MyFunc<in K!, out V!>!) -> V!): ConcMap<K, V>
|
||||
public /*synthesized*/ fun </*0*/ K, /*1*/ V> MyFunc(/*0*/ function: (K!) -> V!): MyFunc<K, V>
|
||||
public fun concurrentMap(): kotlin.Unit
|
||||
|
||||
public open class ConcHashMap</*0*/ K, /*1*/ V> : ConcMap<K!, V!> {
|
||||
public constructor ConcHashMap</*0*/ K, /*1*/ V>()
|
||||
java.lang.Override() public/*package*/ final override /*1*/ /*synthesized*/ fun computeIfAbsent(/*0*/ key: K!, /*1*/ mappingFunction: ((K!) -> V!)!): V!
|
||||
java.lang.Override() public/*package*/ open override /*1*/ fun computeIfAbsent(/*0*/ key: K!, /*1*/ mappingFunction: MyFunc<in K!, out V!>!): V!
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public interface ConcMap</*0*/ K, /*1*/ V> {
|
||||
public final /*synthesized*/ fun computeIfAbsent(/*0*/ key: K!, /*1*/ mappingFunction: ((K!) -> V!)!): V!
|
||||
public abstract fun computeIfAbsent(/*0*/ key: K!, /*1*/ mappingFunction: MyFunc<in K!, out V!>!): V!
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public interface MyFunc</*0*/ K, /*1*/ V> {
|
||||
public abstract fun apply(/*0*/ String: K!): V!
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
// FILE: MyFunc.java
|
||||
|
||||
public interface MyFunc {
|
||||
String apply(String x);
|
||||
}
|
||||
|
||||
// FILE: A.java
|
||||
public interface A<K> {
|
||||
K foo(K key, MyFunc f);
|
||||
}
|
||||
|
||||
// FILE: B.java
|
||||
public class B<E> implements A<E> {
|
||||
@Override
|
||||
public E foo(E key, MyFunc f) {return null;}
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
|
||||
fun main() {
|
||||
B<String>().foo("") { "" }
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package
|
||||
|
||||
public /*synthesized*/ fun </*0*/ K> A(/*0*/ function: (K!, MyFunc!) -> K!): A<K>
|
||||
public /*synthesized*/ fun MyFunc(/*0*/ function: (kotlin.String!) -> kotlin.String!): MyFunc
|
||||
internal fun main(): kotlin.Unit
|
||||
|
||||
public interface A</*0*/ K> {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public final /*synthesized*/ fun foo(/*0*/ key: K!, /*1*/ f: ((kotlin.String!) -> kotlin.String!)!): K!
|
||||
public abstract fun foo(/*0*/ key: K!, /*1*/ f: MyFunc!): K!
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public open class B</*0*/ E> : A<E!> {
|
||||
public constructor B</*0*/ E>()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
java.lang.Override() public final override /*1*/ /*synthesized*/ fun foo(/*0*/ key: E!, /*1*/ f: ((kotlin.String!) -> kotlin.String!)!): E!
|
||||
java.lang.Override() public open override /*1*/ fun foo(/*0*/ key: E!, /*1*/ f: MyFunc!): E!
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public interface MyFunc {
|
||||
public abstract fun apply(/*0*/ x: kotlin.String!): kotlin.String!
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
Reference in New Issue
Block a user