FIR: Weaken some UPPER_BOUND_VIOLATED restrictions
See test data at starProjectionInsteadOutCaptured.kt ^KT-49412 Fixed ^KT-50230 Relates ^KT-48044 Fixed
This commit is contained in:
+18
@@ -140,3 +140,21 @@ FILE: upperBoundViolated.kt
|
||||
|
||||
}
|
||||
public final typealias Alias<V1> = R|(Class<V1>) -> kotlin/Boolean|
|
||||
public abstract class Base<T : R|Base<T>|> : R|kotlin/Any| {
|
||||
public constructor<T : R|Base<T>|>(): R|Base<T>| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
}
|
||||
public final class DerivedOut<out O : R|Base<out O>|> : R|kotlin/Any| {
|
||||
public constructor<out O : R|Base<out O>|>(): R|DerivedOut<O>| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
}
|
||||
public final class DerivedIn<in I : R|Base<in I>|> : R|kotlin/Any| {
|
||||
public constructor<in I : R|Base<in I>|>(): R|DerivedIn<I>| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -55,7 +55,7 @@ class Test1<S1 : Test1<S1, K>, K : Any>
|
||||
class Test2<S2 : Test1<S2, *>>
|
||||
|
||||
class Test3<S3 : Test3<S3, in K>, K : Any>
|
||||
class Test4<S4 : Test3<<!UPPER_BOUND_VIOLATED!>S4<!>, out Any>>
|
||||
class Test4<S4 : Test3<S4, out Any>>
|
||||
|
||||
class Test5<S5 : Test5<S5, in K>, K : Any>
|
||||
class Test6<S6 : Test5<S6, in Any>>
|
||||
@@ -66,9 +66,8 @@ class Test8<S8 : Test7<S8, <!UPPER_BOUND_VIOLATED!>in Any<!>>>
|
||||
class Class<V : Any>
|
||||
typealias Alias <V1> = (Class<V1>) -> Boolean
|
||||
|
||||
/* TODO: Should not be errors. Uncomment after fixing of https://youtrack.jetbrains.com/issue/KT-48044
|
||||
abstract class Base<T : Base<T>> {}
|
||||
class DerivedOut<out O : Base<out O>> {}
|
||||
class DerivedIn<in I : Base<in I>> {}*/
|
||||
class DerivedIn<in I : Base<in I>> {}
|
||||
|
||||
|
||||
|
||||
+18
@@ -13881,6 +13881,18 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti
|
||||
runTest("compiler/testData/diagnostics/tests/inference/underscoredTypeInForbiddenPositions.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("unsoundness1.kt")
|
||||
public void testUnsoundness1() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/unsoundness1.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("unsoundness2.kt")
|
||||
public void testUnsoundness2() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/unsoundness2.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("useFunctionLiteralsToInferType.kt")
|
||||
public void testUseFunctionLiteralsToInferType() throws Exception {
|
||||
@@ -31083,6 +31095,12 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti
|
||||
runTest("compiler/testData/diagnostics/tests/typeParameters/repeatedBound.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("starProjectionInsteadOutCaptured.kt")
|
||||
public void testStarProjectionInsteadOutCaptured() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/typeParameters/starProjectionInsteadOutCaptured.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("upperBoundCannotBeArray.kt")
|
||||
public void testUpperBoundCannotBeArray() throws Exception {
|
||||
|
||||
+18
@@ -13881,6 +13881,18 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac
|
||||
runTest("compiler/testData/diagnostics/tests/inference/underscoredTypeInForbiddenPositions.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("unsoundness1.kt")
|
||||
public void testUnsoundness1() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/unsoundness1.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("unsoundness2.kt")
|
||||
public void testUnsoundness2() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/unsoundness2.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("useFunctionLiteralsToInferType.kt")
|
||||
public void testUseFunctionLiteralsToInferType() throws Exception {
|
||||
@@ -31083,6 +31095,12 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac
|
||||
runTest("compiler/testData/diagnostics/tests/typeParameters/repeatedBound.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("starProjectionInsteadOutCaptured.kt")
|
||||
public void testStarProjectionInsteadOutCaptured() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/typeParameters/starProjectionInsteadOutCaptured.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("upperBoundCannotBeArray.kt")
|
||||
public void testUpperBoundCannotBeArray() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user