Don't use TypeIntersector when loading generic Java constructors

This is not entirely type-safe but this case is so rare that hardly anyone will
be able to spot the change
This commit is contained in:
Alexander Udalov
2015-10-23 20:18:10 +03:00
parent 86bc21da30
commit d6e87c50ab
4 changed files with 45 additions and 18 deletions
@@ -0,0 +1,18 @@
// FILE: J.java
import java.io.Serializable;
public class J {
public <T extends Cloneable & Serializable> J(T t) {}
}
// FILE: K.kt
import java.io.Serializable
// TODO: report TYPE_MISMATCH here as well
fun cloneable(c: Cloneable) = J(c)
fun serializable(s: Serializable) = J(<!TYPE_MISMATCH!>s<!>)
fun <T> both(t: T) where T : Cloneable, T : Serializable = J(t)
@@ -0,0 +1,12 @@
package
public fun </*0*/ T : kotlin.Cloneable> both(/*0*/ t: T): J where T : java.io.Serializable
public fun cloneable(/*0*/ c: kotlin.Cloneable): J
public fun serializable(/*0*/ s: java.io.Serializable): J
public open class J {
public constructor J(/*0*/ t: kotlin.Cloneable!)
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
}