diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/ResolvedAtomCompleter.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/ResolvedAtomCompleter.kt index efb40162fc1..98bc7ea1263 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/ResolvedAtomCompleter.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tower/ResolvedAtomCompleter.kt @@ -311,6 +311,8 @@ class ResolvedAtomCompleter( topLevelCallContext.trace, callableReferenceExpression ) + + kotlinToResolvedCallTransformer.runCallCheckers(resolvedCall, topLevelCallCheckerContext) } private fun completeCollectionLiteralCalls(collectionLiteralArgument: ResolvedCollectionLiteralAtom) { diff --git a/compiler/testData/diagnostics/testsWithStdLib/regression/kt34391.kt b/compiler/testData/diagnostics/testsWithStdLib/regression/kt34391.kt new file mode 100644 index 00000000000..aa6bcc61dcf --- /dev/null +++ b/compiler/testData/diagnostics/testsWithStdLib/regression/kt34391.kt @@ -0,0 +1,19 @@ +// !LANGUAGE: +NewInference + +fun main() { + val list = listOf(A()) + list.forEach(A::foo) + list.forEach { + it.foo() + } +} + +class A { + @ExperimentalTime + fun foo() { + println("a") + } +} + +@Experimental(level = Experimental.Level.ERROR) +annotation class ExperimentalTime diff --git a/compiler/testData/diagnostics/testsWithStdLib/regression/kt34391.txt b/compiler/testData/diagnostics/testsWithStdLib/regression/kt34391.txt new file mode 100644 index 00000000000..5e9203e57bb --- /dev/null +++ b/compiler/testData/diagnostics/testsWithStdLib/regression/kt34391.txt @@ -0,0 +1,18 @@ +package + +public fun main(): kotlin.Unit + +public final class A { + public constructor A() + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + @ExperimentalTime public final fun foo(): kotlin.Unit + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String +} + +@kotlin.Experimental(level = Level.ERROR) public final annotation class ExperimentalTime : kotlin.Annotation { + public constructor ExperimentalTime() + 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/DiagnosticsTestWithStdLibGenerated.java b/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestWithStdLibGenerated.java index 8edcab4c5d6..258e58f7a21 100644 --- a/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestWithStdLibGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/checkers/DiagnosticsTestWithStdLibGenerated.java @@ -3156,6 +3156,11 @@ public class DiagnosticsTestWithStdLibGenerated extends AbstractDiagnosticsTestW runTest("compiler/testData/diagnostics/testsWithStdLib/regression/kt26806.kt"); } + @TestMetadata("kt34391.kt") + public void testKt34391() throws Exception { + runTest("compiler/testData/diagnostics/testsWithStdLib/regression/kt34391.kt"); + } + @TestMetadata("kt9345.kt") public void testKt9345() throws Exception { runTest("compiler/testData/diagnostics/testsWithStdLib/regression/kt9345.kt"); diff --git a/compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsTestWithStdLibUsingJavacGenerated.java b/compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsTestWithStdLibUsingJavacGenerated.java index 9a72281aec5..0f0e44936bb 100644 --- a/compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsTestWithStdLibUsingJavacGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsTestWithStdLibUsingJavacGenerated.java @@ -3156,6 +3156,11 @@ public class DiagnosticsTestWithStdLibUsingJavacGenerated extends AbstractDiagno runTest("compiler/testData/diagnostics/testsWithStdLib/regression/kt26806.kt"); } + @TestMetadata("kt34391.kt") + public void testKt34391() throws Exception { + runTest("compiler/testData/diagnostics/testsWithStdLib/regression/kt34391.kt"); + } + @TestMetadata("kt9345.kt") public void testKt9345() throws Exception { runTest("compiler/testData/diagnostics/testsWithStdLib/regression/kt9345.kt");