Supported SAM adapters with type parameters.

This commit is contained in:
Evgeny Gerashchenko
2013-04-18 17:15:40 +04:00
parent db8d285b25
commit 8c4e45de9a
7 changed files with 73 additions and 3 deletions
@@ -0,0 +1,19 @@
package test;
import java.lang.UnsupportedOperationException;
import java.util.*;
import java.util.Comparator;
public class TypeParameterOfMethod {
public static <T> T max(Comparator<T> comparator, T value1, T value2) {
return comparator.compare(value1, value2) > 0 ? value1 : value2;
}
public static <T extends CharSequence> T max2(Comparator<T> comparator, T value1, T value2) {
return comparator.compare(value1, value2) > 0 ? value1 : value2;
}
public static <A extends CharSequence, B extends List<A>> void method(Comparator<A> a, B b) {
throw new UnsupportedOperationException();
}
}
@@ -0,0 +1,14 @@
package test
public open class TypeParameterOfMethod : java.lang.Object {
public constructor TypeParameterOfMethod()
}
package TypeParameterOfMethod {
public open /*synthesized*/ fun </*0*/ T> max(/*0*/ p0 : ((T?, T?) -> jet.Int)?, /*1*/ p1 : T?, /*2*/ p2 : T?) : T?
public open fun </*0*/ T> max(/*0*/ p0 : java.util.Comparator<T>?, /*1*/ p1 : T?, /*2*/ p2 : T?) : T?
public open /*synthesized*/ fun </*0*/ T : jet.CharSequence?> max2(/*0*/ p0 : ((T?, T?) -> jet.Int)?, /*1*/ p1 : T?, /*2*/ p2 : T?) : T?
public open fun </*0*/ T : jet.CharSequence?> max2(/*0*/ p0 : java.util.Comparator<T>?, /*1*/ p1 : T?, /*2*/ p2 : T?) : T?
public open /*synthesized*/ fun </*0*/ A : jet.CharSequence?, /*1*/ B : jet.List<A>?> method(/*0*/ p0 : ((A?, A?) -> jet.Int)?, /*1*/ p1 : B?) : jet.Unit
public open fun </*0*/ A : jet.CharSequence?, /*1*/ B : jet.List<A>?> method(/*0*/ p0 : java.util.Comparator<A>?, /*1*/ p1 : B?) : jet.Unit
}