[FE 1.0] Fix subtyping for captured integer literal types
^KT-50877 Fixed
This commit is contained in:
committed by
teamcity
parent
7395f8e019
commit
ec6ec20728
@@ -2,6 +2,8 @@
|
||||
// IGNORE_BACKEND: JVM, JVM_IR, ANDROID, ANDROID_IR
|
||||
// IGNORE_LIGHT_ANALYSIS
|
||||
// WITH_STDLIB
|
||||
// JVM_TARGET: 1.8
|
||||
// IGNORE_BACKEND: ANDROID
|
||||
// FULL_JDK
|
||||
|
||||
// This test fails on FE 1.0, but works in production compiler (see KT-49191):
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
// FULL_JDK
|
||||
// WITH_STDLIB
|
||||
|
||||
// FILE: Schematic.kt
|
||||
class Schematic {
|
||||
var name: String? = null
|
||||
|
||||
var error: String? = null
|
||||
|
||||
override fun toString(): String {
|
||||
return name!!
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: SortedListModel.java
|
||||
import java.util.Comparator;
|
||||
|
||||
public class SortedListModel<T> {
|
||||
public SortedListModel(Comparator<? super T> comparator) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// FILE: main.kt
|
||||
val model = SortedListModel<Schematic>(Comparator.comparing { b1: Schematic ->
|
||||
when {
|
||||
b1.error != null -> 2
|
||||
b1.name!!.contains(":") -> 1
|
||||
else -> 0
|
||||
}
|
||||
}.thenComparing { b1: Schematic -> b1.name!! })
|
||||
@@ -0,0 +1,31 @@
|
||||
// FULL_JDK
|
||||
// WITH_STDLIB
|
||||
|
||||
// FILE: Schematic.kt
|
||||
class Schematic {
|
||||
var name: String? = null
|
||||
|
||||
var error: String? = null
|
||||
|
||||
override fun toString(): String {
|
||||
return name!!
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: SortedListModel.java
|
||||
import java.util.Comparator;
|
||||
|
||||
public class SortedListModel<T> {
|
||||
public SortedListModel(Comparator<? super T> comparator) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// FILE: main.kt
|
||||
val model = SortedListModel<Schematic>(Comparator.comparing { b1: Schematic ->
|
||||
when {
|
||||
b1.error != null -> 2
|
||||
b1.name!!.contains(":") -> 1
|
||||
else -> 0
|
||||
}
|
||||
}.thenComparing { b1: Schematic -> b1.name!! })
|
||||
@@ -0,0 +1,19 @@
|
||||
package
|
||||
|
||||
public val model: SortedListModel<Schematic>
|
||||
|
||||
public final class Schematic {
|
||||
public constructor Schematic()
|
||||
public final var error: kotlin.String?
|
||||
public final var name: 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*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public open class SortedListModel</*0*/ T : kotlin.Any!> {
|
||||
public constructor SortedListModel</*0*/ T : kotlin.Any!>(/*0*/ comparator: java.util.Comparator<in T!>!)
|
||||
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