[FIR] Fix projection of Comparable supertype for ILT

#KT-39048 Fixed
This commit is contained in:
Dmitriy Novozhilov
2020-07-02 15:35:14 +03:00
parent a882a9dff5
commit 8311c1f0e2
8 changed files with 36 additions and 4 deletions
@@ -0,0 +1,14 @@
// ISSUE: KT-39048
// FILE: JavaClass.java
public class JavaClass<T extends Comparable<? super T>> {
public JavaClass(T from) {}
}
// FILE: main.kt
class K<T : Comparable<T>>(t: T)
fun main() {
K(0)
JavaClass(0)
}
@@ -0,0 +1,11 @@
FILE: main.kt
public final class K<T : R|kotlin/Comparable<T>|> : R|kotlin/Any| {
public constructor<T : R|kotlin/Comparable<T>|>(t: R|T|): R|K<T>| {
super<R|kotlin/Any|>()
}
}
public final fun main(): R|kotlin/Unit| {
R|/K.K|<R|kotlin/Int|>(Int(0))
R|/JavaClass.JavaClass|<R|ft<ILT: 0, ILT: 0?>!|>(Int(0))
}
@@ -1479,6 +1479,11 @@ public class FirDiagnosticsTestGenerated extends AbstractFirDiagnosticsTest {
runTest("compiler/fir/analysis-tests/testData/resolve/inference/extensionCallableReferences.kt");
}
@TestMetadata("integerLiteralAsComparable.kt")
public void testIntegerLiteralAsComparable() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/inference/integerLiteralAsComparable.kt");
}
@TestMetadata("intersectionTypesInConstraints.kt")
public void testIntersectionTypesInConstraints() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/inference/intersectionTypesInConstraints.kt");
@@ -1479,6 +1479,11 @@ public class FirDiagnosticsWithLightTreeTestGenerated extends AbstractFirDiagnos
runTest("compiler/fir/analysis-tests/testData/resolve/inference/extensionCallableReferences.kt");
}
@TestMetadata("integerLiteralAsComparable.kt")
public void testIntegerLiteralAsComparable() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/inference/integerLiteralAsComparable.kt");
}
@TestMetadata("intersectionTypesInConstraints.kt")
public void testIntersectionTypesInConstraints() throws Exception {
runTest("compiler/fir/analysis-tests/testData/resolve/inference/intersectionTypesInConstraints.kt");