mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-09 08:31:29 +00:00
Fixed mapping generic type with multiple bounds from Java to Kotlin.
#KT-3480 fixed
This commit is contained in:
committed by
Zalim Bashorov
parent
e47c84f40f
commit
d3570153ef
7
compiler/testData/codegen/boxWithJava/functions/max.java
Normal file
7
compiler/testData/codegen/boxWithJava/functions/max.java
Normal file
@@ -0,0 +1,7 @@
|
||||
import java.util.*;
|
||||
|
||||
public class max {
|
||||
public static <T extends Object & Comparable<? super T>> T max(Collection<? extends T> coll) {
|
||||
return Collections.max(coll);
|
||||
}
|
||||
}
|
||||
3
compiler/testData/codegen/boxWithJava/functions/max.kt
Normal file
3
compiler/testData/codegen/boxWithJava/functions/max.kt
Normal file
@@ -0,0 +1,3 @@
|
||||
fun box(): String {
|
||||
return max.max(java.util.Arrays.asList("AK", "OK", "EK"))!!
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
import java.util.Collection;
|
||||
|
||||
public class unrelatedUpperBounds {
|
||||
public static <T extends CharSequence & java.io.Serializable> T id(T p) {
|
||||
return p;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fun box(): String {
|
||||
return unrelatedUpperBounds.id("OK" as java.lang.String)!! as jet.String
|
||||
}
|
||||
Reference in New Issue
Block a user