Fix JetType.equals(): flexible types are not equal to non-flexible ones, when we store them in a HashSet
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
// FILE: p/J.java
|
||||
package p;
|
||||
|
||||
public interface J {
|
||||
public interface Super<T> {}
|
||||
public interface Sub<T> extends Super<T> {}
|
||||
}
|
||||
|
||||
// FILE: k.kt
|
||||
|
||||
import p.J.*
|
||||
|
||||
class Foo<T>: Sub<T> {
|
||||
fun foo(): Super<T> {
|
||||
return <!TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>Foo<!>()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package
|
||||
|
||||
internal final class Foo</*0*/ T> : p.J.Sub<T> {
|
||||
public constructor Foo</*0*/ T>()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
internal final fun foo(): p.J.Super<T>
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
// FILE: p/J.java
|
||||
|
||||
package p;
|
||||
|
||||
public class J {
|
||||
public static J j() { return null; }
|
||||
}
|
||||
|
||||
// FILE: k.kt
|
||||
|
||||
import p.*
|
||||
|
||||
fun foo(): J? = null
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val v = foo() ?: J.j()
|
||||
if (v != null) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
package
|
||||
|
||||
internal fun foo(): p.J?
|
||||
internal fun main(/*0*/ args: kotlin.Array<kotlin.String>): kotlin.Unit
|
||||
Reference in New Issue
Block a user