diff --git a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosisCompilerTestFE10TestdataTestGenerated.java b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosisCompilerTestFE10TestdataTestGenerated.java index 6dee0b68fe2..f4d50766ec3 100644 --- a/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosisCompilerTestFE10TestdataTestGenerated.java +++ b/analysis/low-level-api-fir/tests/org/jetbrains/kotlin/analysis/low/level/api/fir/diagnostic/compiler/based/DiagnosisCompilerTestFE10TestdataTestGenerated.java @@ -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 { diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java index e4bf2ab8254..a006e033fd8 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java @@ -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 { diff --git a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsWithLightTreeTestGenerated.java b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsWithLightTreeTestGenerated.java index d9462fac4d6..645ebe1cb3a 100644 --- a/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsWithLightTreeTestGenerated.java +++ b/compiler/fir/analysis-tests/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsWithLightTreeTestGenerated.java @@ -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 { diff --git a/compiler/testData/diagnostics/testsWithStdLib/greater.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/greater.fir.kt new file mode 100644 index 00000000000..8478083f4cb --- /dev/null +++ b/compiler/testData/diagnostics/testsWithStdLib/greater.fir.kt @@ -0,0 +1,12 @@ +class Expression(val x: T) + +class GreaterOp(val expr1: Expression<*>, val expr2: Expression<*>) + +fun , S : T?> Expression.greater(other: T): GreaterOp = + GreaterOp(this, Expression(other)) + +fun foo(countExpr: Expression) { + countExpr.greater(0) + countExpr.greater("0") + countExpr.greater("0") +} diff --git a/compiler/testData/diagnostics/testsWithStdLib/greater.kt b/compiler/testData/diagnostics/testsWithStdLib/greater.kt new file mode 100644 index 00000000000..16cc23c12b4 --- /dev/null +++ b/compiler/testData/diagnostics/testsWithStdLib/greater.kt @@ -0,0 +1,12 @@ +class Expression(val x: T) + +class GreaterOp(val expr1: Expression<*>, val expr2: Expression<*>) + +fun , S : T?> Expression.greater(other: T): GreaterOp = + GreaterOp(this, Expression(other)) + +fun foo(countExpr: Expression) { + countExpr.greater(0) + countExpr.greater("0") + countExpr.greater("0") +} diff --git a/compiler/testData/diagnostics/testsWithStdLib/greater.txt b/compiler/testData/diagnostics/testsWithStdLib/greater.txt new file mode 100644 index 00000000000..a34bd879b12 --- /dev/null +++ b/compiler/testData/diagnostics/testsWithStdLib/greater.txt @@ -0,0 +1,21 @@ +package + +public fun foo(/*0*/ countExpr: Expression): kotlin.Unit +public fun , /*1*/ S : T?> Expression.greater(/*0*/ other: T): GreaterOp + +public final class Expression { + public constructor Expression(/*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 +} diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java index f55e5e55bac..51aac68ccdd 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java @@ -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 {