diff --git a/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirDiagnosticsSmokeTestGenerated.java b/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirDiagnosticsSmokeTestGenerated.java index be4f7c55b29..c0b47263d86 100644 --- a/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirDiagnosticsSmokeTestGenerated.java +++ b/compiler/fir/resolve/tests/org/jetbrains/kotlin/fir/FirDiagnosticsSmokeTestGenerated.java @@ -9961,6 +9961,11 @@ public class FirDiagnosticsSmokeTestGenerated extends AbstractFirDiagnosticsSmok runTest("compiler/testData/diagnostics/tests/inference/commonSystem/inferenceWithUpperBoundsInLambda.kt"); } + @TestMetadata("kt30300.kt") + public void testKt30300() throws Exception { + runTest("compiler/testData/diagnostics/tests/inference/commonSystem/kt30300.kt"); + } + @TestMetadata("kt3372toCollection.kt") public void testKt3372toCollection() throws Exception { runTest("compiler/testData/diagnostics/tests/inference/commonSystem/kt3372toCollection.kt"); diff --git a/compiler/testData/diagnostics/tests/inference/commonSystem/kt30300.kt b/compiler/testData/diagnostics/tests/inference/commonSystem/kt30300.kt new file mode 100644 index 00000000000..00dba302127 --- /dev/null +++ b/compiler/testData/diagnostics/tests/inference/commonSystem/kt30300.kt @@ -0,0 +1,21 @@ +// !LANGUAGE: +NewInference +// !DIAGNOSTICS: -UNUSED_PARAMETER +// Issue: KT-30300 + +class Inv +class InvOut + +class Sample + +fun select(x: T, y: T): T = x +fun selectInvOut(a: InvOut, b: InvOut): InvOut = TODO() +fun emptyInvOut(): InvOut = TODO() +fun create(element: S): InvOut, S> = TODO() + +fun test(s: Sample, b: InvOut, Any?>) { + , kotlin.Any?>")!>selectInvOut( + b, + select(create(s), emptyInvOut()) + ) +} + diff --git a/compiler/testData/diagnostics/tests/inference/commonSystem/kt30300.txt b/compiler/testData/diagnostics/tests/inference/commonSystem/kt30300.txt new file mode 100644 index 00000000000..54458dd67c1 --- /dev/null +++ b/compiler/testData/diagnostics/tests/inference/commonSystem/kt30300.txt @@ -0,0 +1,28 @@ +package + +public fun create(/*0*/ element: S): InvOut, S> +public fun emptyInvOut(): InvOut +public fun select(/*0*/ x: T, /*1*/ y: T): T +public fun selectInvOut(/*0*/ a: InvOut, /*1*/ b: InvOut): InvOut +public fun test(/*0*/ s: Sample, /*1*/ b: InvOut, kotlin.Any?>): kotlin.Unit + +public final class Inv { + public constructor Inv() + 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 InvOut { + public constructor InvOut() + 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 Sample { + public constructor Sample() + 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/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java index c23c5d0de99..242862fc632 100644 --- a/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestGenerated.java @@ -9968,6 +9968,11 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest { runTest("compiler/testData/diagnostics/tests/inference/commonSystem/inferenceWithUpperBoundsInLambda.kt"); } + @TestMetadata("kt30300.kt") + public void testKt30300() throws Exception { + runTest("compiler/testData/diagnostics/tests/inference/commonSystem/kt30300.kt"); + } + @TestMetadata("kt3372toCollection.kt") public void testKt3372toCollection() throws Exception { runTest("compiler/testData/diagnostics/tests/inference/commonSystem/kt3372toCollection.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsUsingJavacTestGenerated.java b/compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsUsingJavacTestGenerated.java index b41e227c65e..93729a77fd4 100644 --- a/compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsUsingJavacTestGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsUsingJavacTestGenerated.java @@ -9963,6 +9963,11 @@ public class DiagnosticsUsingJavacTestGenerated extends AbstractDiagnosticsUsing runTest("compiler/testData/diagnostics/tests/inference/commonSystem/inferenceWithUpperBoundsInLambda.kt"); } + @TestMetadata("kt30300.kt") + public void testKt30300() throws Exception { + runTest("compiler/testData/diagnostics/tests/inference/commonSystem/kt30300.kt"); + } + @TestMetadata("kt3372toCollection.kt") public void testKt3372toCollection() throws Exception { runTest("compiler/testData/diagnostics/tests/inference/commonSystem/kt3372toCollection.kt");