FIR: add test for KT-51357
This commit is contained in:
+6
@@ -33449,6 +33449,12 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/exitProcess.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("greater.kt")
|
||||
public void testGreater() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/greater.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("hugeUnresolvedKotlinxHtml.kt")
|
||||
public void testHugeUnresolvedKotlinxHtml() throws Exception {
|
||||
|
||||
+6
@@ -33449,6 +33449,12 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/exitProcess.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("greater.kt")
|
||||
public void testGreater() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/greater.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("hugeUnresolvedKotlinxHtml.kt")
|
||||
public void testHugeUnresolvedKotlinxHtml() throws Exception {
|
||||
|
||||
+6
@@ -33449,6 +33449,12 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/exitProcess.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("greater.kt")
|
||||
public void testGreater() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/greater.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("hugeUnresolvedKotlinxHtml.kt")
|
||||
public void testHugeUnresolvedKotlinxHtml() throws Exception {
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
class Expression<T>(val x: T)
|
||||
|
||||
class GreaterOp(val expr1: Expression<*>, val expr2: Expression<*>)
|
||||
|
||||
fun <T : Comparable<T>, S : T?> Expression<in S>.greater(other: T): GreaterOp =
|
||||
GreaterOp(this, Expression(other))
|
||||
|
||||
fun foo(countExpr: Expression<Long>) {
|
||||
<!NEW_INFERENCE_ERROR!>countExpr.greater(0)<!>
|
||||
countExpr.greater("0")
|
||||
countExpr.greater<String, Nothing>("0")
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
class Expression<T>(val x: T)
|
||||
|
||||
class GreaterOp(val expr1: Expression<*>, val expr2: Expression<*>)
|
||||
|
||||
fun <T : Comparable<T>, S : T?> Expression<in S>.greater(other: T): GreaterOp =
|
||||
GreaterOp(this, Expression(other))
|
||||
|
||||
fun foo(countExpr: Expression<Long>) {
|
||||
countExpr.greater(0)
|
||||
countExpr.greater("0")
|
||||
countExpr.greater<String, Nothing>("0")
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package
|
||||
|
||||
public fun foo(/*0*/ countExpr: Expression<kotlin.Long>): kotlin.Unit
|
||||
public fun </*0*/ T : kotlin.Comparable<T>, /*1*/ S : T?> Expression<in S>.greater(/*0*/ other: T): GreaterOp
|
||||
|
||||
public final class Expression</*0*/ T> {
|
||||
public constructor Expression</*0*/ T>(/*0*/ x: T)
|
||||
public final val x: 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 GreaterOp {
|
||||
public constructor GreaterOp(/*0*/ expr1: Expression<*>, /*1*/ expr2: Expression<*>)
|
||||
public final val expr1: Expression<*>
|
||||
public final val expr2: Expression<*>
|
||||
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
@@ -33539,6 +33539,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/exitProcess.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("greater.kt")
|
||||
public void testGreater() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/greater.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("hugeUnresolvedKotlinxHtml.kt")
|
||||
public void testHugeUnresolvedKotlinxHtml() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user