diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/DiagnosticReporterByTrackingStrategy.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/DiagnosticReporterByTrackingStrategy.kt index 456acb5adb8..f1c48ecd0a6 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/DiagnosticReporterByTrackingStrategy.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/DiagnosticReporterByTrackingStrategy.kt @@ -584,7 +584,7 @@ class DiagnosticReporterByTrackingStrategy( val expression = if (psiCall is CallTransformer.CallForImplicitInvoke) { psiCall.outerCall.calleeExpression } else { - psiCall.calleeExpression + psiCall.calleeExpression?.takeIf { it.isPhysical } ?: psiCall.callElement } ?: return val typeVariable = error.typeVariable as? TypeVariableFromCallableDescriptor ?: return diff --git a/compiler/testData/diagnostics/testsWithStdLib/builderInference/buildListToUpperBoundInLazy.kt b/compiler/testData/diagnostics/testsWithStdLib/builderInference/buildListToUpperBoundInLazy.kt index 7dbcfc2bce1..cf98dd1421d 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/builderInference/buildListToUpperBoundInLazy.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/builderInference/buildListToUpperBoundInLazy.kt @@ -28,7 +28,7 @@ internal class TowerDataElementsForName2() { } internal class TowerDataElementsForName3() { - val reversedFilteredLocalScopes by lazy(LazyThreadSafetyMode.NONE) { + val reversedFilteredLocalScopes by lazy(LazyThreadSafetyMode.NONE) { @OptIn(ExperimentalStdlibApi::class) buildList l1@ { for (i in lastIndex downTo 0) { @@ -43,7 +43,7 @@ internal class TowerDataElementsForName3() { } } } - } + } } internal class TowerDataElementsForName4() {