FE: add test reproducing KT-54411
This commit is contained in:
committed by
Space Team
parent
c32d851585
commit
d5c8d9fecc
+6
@@ -15965,6 +15965,12 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag
|
||||
runTest("compiler/testData/diagnostics/tests/inference/emptyIntersectionTypes/kt52431.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt54411.kt")
|
||||
public void testKt54411() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/emptyIntersectionTypes/kt54411.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nullableEmptyIntersection.kt")
|
||||
public void testNullableEmptyIntersection() throws Exception {
|
||||
|
||||
+6
@@ -15971,6 +15971,12 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti
|
||||
runTest("compiler/testData/diagnostics/tests/inference/emptyIntersectionTypes/kt52431.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt54411.kt")
|
||||
public void testKt54411() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/emptyIntersectionTypes/kt54411.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nullableEmptyIntersection.kt")
|
||||
public void testNullableEmptyIntersection() throws Exception {
|
||||
|
||||
+6
@@ -15965,6 +15965,12 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac
|
||||
runTest("compiler/testData/diagnostics/tests/inference/emptyIntersectionTypes/kt52431.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt54411.kt")
|
||||
public void testKt54411() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/emptyIntersectionTypes/kt54411.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nullableEmptyIntersection.kt")
|
||||
public void testNullableEmptyIntersection() throws Exception {
|
||||
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
// FIR_IDENTICAL
|
||||
class AtomicRef<T>(val value: T)
|
||||
|
||||
inline fun <F : Segment<F>> AtomicRef<F>.findSegmentAndMoveForward(createNewSegment: (prev: F?) -> F) = null
|
||||
|
||||
interface Queue<Q> {
|
||||
val tail: AtomicRef<OneElementSegment<Q>>
|
||||
|
||||
fun enqueue(element: Q) {
|
||||
// F <: Segment<F> from upper bound
|
||||
// F <: OneElementSegment<Segment<F>>? from ::createSegment argument. ? is questionable here
|
||||
// (F?) -> F <: (OneElementSegment<C>?) -> OneElementSegment<C>
|
||||
tail.<!INFERRED_TYPE_VARIABLE_INTO_POSSIBLE_EMPTY_INTERSECTION!>findSegmentAndMoveForward<!>(::createSegment)
|
||||
}
|
||||
}
|
||||
|
||||
private fun <C> createSegment(prev: OneElementSegment<C>?) = OneElementSegment<C>()
|
||||
|
||||
class OneElementSegment<O>() : Segment<OneElementSegment<O>>()
|
||||
|
||||
abstract class Segment<S : Segment<S>>
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
package
|
||||
|
||||
private fun </*0*/ C> createSegment(/*0*/ prev: OneElementSegment<C>?): OneElementSegment<C>
|
||||
public inline fun </*0*/ F : Segment<F>> AtomicRef<F>.findSegmentAndMoveForward(/*0*/ createNewSegment: (prev: F?) -> F): kotlin.Nothing?
|
||||
|
||||
public final class AtomicRef</*0*/ T> {
|
||||
public constructor AtomicRef</*0*/ T>(/*0*/ value: T)
|
||||
public final val value: 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
|
||||
}
|
||||
|
||||
public final class OneElementSegment</*0*/ O> : Segment<OneElementSegment<O>> {
|
||||
public constructor OneElementSegment</*0*/ O>()
|
||||
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
|
||||
}
|
||||
|
||||
public interface Queue</*0*/ Q> {
|
||||
public abstract val tail: AtomicRef<OneElementSegment<Q>>
|
||||
public open fun enqueue(/*0*/ element: Q): kotlin.Unit
|
||||
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
|
||||
}
|
||||
|
||||
public abstract class Segment</*0*/ S : Segment<S>> {
|
||||
public constructor Segment</*0*/ S : Segment<S>>()
|
||||
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
|
||||
}
|
||||
Generated
+6
@@ -15971,6 +15971,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/emptyIntersectionTypes/kt52431.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("kt54411.kt")
|
||||
public void testKt54411() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/tests/inference/emptyIntersectionTypes/kt54411.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("nullableEmptyIntersection.kt")
|
||||
public void testNullableEmptyIntersection() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user