From 59257e47c963ec594913434eadebbb02d6a5863f Mon Sep 17 00:00:00 2001 From: Ivan Kochurkin Date: Tue, 22 Jun 2021 23:23:02 +0300 Subject: [PATCH] [FIR] Implement FUNCTION_CALL_EXPECTED --- .../diagnostics/FirDiagnosticsList.kt | 4 ++ .../fir/analysis/diagnostics/FirErrors.kt | 1 + .../diagnostics/FirDefaultErrorMessages.kt | 3 + .../diagnostics/FirDiagnosticRenderers.kt | 2 + .../coneDiagnosticToFirDiagnostic.kt | 1 + .../jetbrains/kotlin/fir/FirCallResolver.kt | 65 +++++++++++++++---- .../fir/resolve/diagnostics/FirDiagnostics.kt | 4 ++ .../diagnostics/tests/ResolveToJava.fir.kt | 4 +- .../bound/functionCallWithoutArguments.fir.kt | 1 - .../bound/functionCallWithoutArguments.kt | 1 + .../tests/incompleteCode/kt2014.fir.kt | 4 +- .../nullabilityAndSmartCasts/kt1778.fir.kt | 6 +- .../tests/recovery/absentLeftHandSide.fir.kt | 6 +- .../tests/regressions/kt10843.fir.kt | 2 +- ...OnVariableWithExtensionFunctionType.fir.kt | 2 +- .../javaProperties/IsNaming.fir.kt | 37 ----------- .../javaProperties/IsNaming.kt | 1 + .../diagnostics/KtFirDataClassConverters.kt | 8 +++ .../api/fir/diagnostics/KtFirDiagnostics.kt | 6 ++ .../fir/diagnostics/KtFirDiagnosticsImpl.kt | 9 +++ idea/testData/checker/ResolveToJava.fir.kt | 4 +- 21 files changed, 106 insertions(+), 65 deletions(-) delete mode 100644 compiler/testData/diagnostics/tests/callableReference/bound/functionCallWithoutArguments.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/IsNaming.fir.kt diff --git a/compiler/fir/checkers/checkers-component-generator/src/org/jetbrains/kotlin/fir/checkers/generator/diagnostics/FirDiagnosticsList.kt b/compiler/fir/checkers/checkers-component-generator/src/org/jetbrains/kotlin/fir/checkers/generator/diagnostics/FirDiagnosticsList.kt index f3c63fd4a87..f0bb0c29ead 100644 --- a/compiler/fir/checkers/checkers-component-generator/src/org/jetbrains/kotlin/fir/checkers/generator/diagnostics/FirDiagnosticsList.kt +++ b/compiler/fir/checkers/checkers-component-generator/src/org/jetbrains/kotlin/fir/checkers/generator/diagnostics/FirDiagnosticsList.kt @@ -102,6 +102,10 @@ object DIAGNOSTICS_LIST : DiagnosticList("FirErrors") { val CALL_RESOLUTION by object : DiagnosticGroup("Call resolution") { val CREATING_AN_INSTANCE_OF_ABSTRACT_CLASS by error() + val FUNCTION_CALL_EXPECTED by error(PositioningStrategy.REFERENCED_NAME_BY_QUALIFIED) { + parameter("functionName") + parameter("hasValueParameters") + } } val SUPER by object : DiagnosticGroup("Super") { diff --git a/compiler/fir/checkers/gen/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt b/compiler/fir/checkers/gen/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt index 9da561daa53..fc0df8bf2c9 100644 --- a/compiler/fir/checkers/gen/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt +++ b/compiler/fir/checkers/gen/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt @@ -119,6 +119,7 @@ object FirErrors { // Call resolution val CREATING_AN_INSTANCE_OF_ABSTRACT_CLASS by error0() + val FUNCTION_CALL_EXPECTED by error2(SourceElementPositioningStrategies.REFERENCED_NAME_BY_QUALIFIED) // Super val SUPER_IS_NOT_AN_EXPRESSION by error0(SourceElementPositioningStrategies.REFERENCED_NAME_BY_QUALIFIED) diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDefaultErrorMessages.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDefaultErrorMessages.kt index 03cc7eb5e02..7f0bd390fcf 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDefaultErrorMessages.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDefaultErrorMessages.kt @@ -13,6 +13,7 @@ import org.jetbrains.kotlin.fir.analysis.diagnostics.FirDiagnosticRenderers.AMBI import org.jetbrains.kotlin.fir.analysis.diagnostics.FirDiagnosticRenderers.DECLARATION_NAME import org.jetbrains.kotlin.fir.analysis.diagnostics.FirDiagnosticRenderers.FIR import org.jetbrains.kotlin.fir.analysis.diagnostics.FirDiagnosticRenderers.FQ_NAMES_IN_TYPES +import org.jetbrains.kotlin.fir.analysis.diagnostics.FirDiagnosticRenderers.FUNCTION_PARAMETERS import org.jetbrains.kotlin.fir.analysis.diagnostics.FirDiagnosticRenderers.NAME import org.jetbrains.kotlin.fir.analysis.diagnostics.FirDiagnosticRenderers.NOT_RENDERED import org.jetbrains.kotlin.fir.analysis.diagnostics.FirDiagnosticRenderers.NULLABLE_STRING @@ -149,6 +150,7 @@ import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.EXTENSION_PROPERT import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.FINAL_SUPERTYPE import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.FINAL_UPPER_BOUND import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.FORBIDDEN_VARARG_PARAMETER_TYPE +import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.FUNCTION_CALL_EXPECTED import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.FUNCTION_DECLARATION_WITH_NO_NAME import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.FUN_INTERFACE_ABSTRACT_METHOD_WITH_DEFAULT_VALUE import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.FUN_INTERFACE_ABSTRACT_METHOD_WITH_TYPE_PARAMETERS @@ -443,6 +445,7 @@ class FirDefaultErrorMessages { TO_STRING ) map.put(CREATING_AN_INSTANCE_OF_ABSTRACT_CLASS, "Cannot create an instance of an abstract class") + map.put(FUNCTION_CALL_EXPECTED, "Function invocation ''{0}({1})'' expected", TO_STRING, FUNCTION_PARAMETERS) // Supertypes map.put(ENUM_AS_SUPERTYPE, "Enum as supertype") diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDiagnosticRenderers.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDiagnosticRenderers.kt index c7cc04b7443..c0195ca4348 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDiagnosticRenderers.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDiagnosticRenderers.kt @@ -119,4 +119,6 @@ object FirDiagnosticRenderers { val NOT_RENDERED = Renderer { "" } + + val FUNCTION_PARAMETERS = Renderer { hasValueParameters: Boolean -> if (hasValueParameters) "..." else "" } } diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/coneDiagnosticToFirDiagnostic.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/coneDiagnosticToFirDiagnostic.kt index 39d78f09c64..ae12aa52752 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/coneDiagnosticToFirDiagnostic.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/coneDiagnosticToFirDiagnostic.kt @@ -40,6 +40,7 @@ private fun ConeDiagnostic.toFirDiagnostic( is ConeUnresolvedSymbolError -> FirErrors.UNRESOLVED_REFERENCE.createOn(source, this.classId.asString()) is ConeUnresolvedNameError -> FirErrors.UNRESOLVED_REFERENCE.createOn(source, this.name.asString()) is ConeUnresolvedQualifierError -> FirErrors.UNRESOLVED_REFERENCE.createOn(source, this.qualifier) + is ConeFunctionCallExpectedError -> FirErrors.FUNCTION_CALL_EXPECTED.createOn(source, this.name.asString(), this.hasValueParameters) is ConeHiddenCandidateError -> FirErrors.INVISIBLE_REFERENCE.createOn(source, this.candidateSymbol) is ConeAmbiguityError -> when { applicability.isSuccess -> FirErrors.OVERLOAD_RESOLUTION_AMBIGUITY.createOn(source, this.candidates.map { it.symbol }) diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/FirCallResolver.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/FirCallResolver.kt index 8c352f1535e..1d868388dc4 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/FirCallResolver.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/FirCallResolver.kt @@ -136,14 +136,18 @@ class FirCallResolver( val info: CallInfo, val applicability: CandidateApplicability, val candidates: Collection, ) - private fun collectCandidates(qualifiedAccess: T, name: Name): ResolutionResult { + private fun collectCandidates( + qualifiedAccess: T, + name: Name, + forceCallKind: CallKind? = null + ): ResolutionResult { val explicitReceiver = qualifiedAccess.explicitReceiver val argumentList = (qualifiedAccess as? FirFunctionCall)?.argumentList ?: FirEmptyArgumentList val typeArguments = (qualifiedAccess as? FirFunctionCall)?.typeArguments.orEmpty() val info = CallInfo( qualifiedAccess, - if (qualifiedAccess is FirFunctionCall) CallKind.Function else CallKind.VariableAccess, + if (qualifiedAccess is FirFunctionCall || forceCallKind == CallKind.Function) CallKind.Function else CallKind.VariableAccess, name, explicitReceiver, argumentList, @@ -195,16 +199,7 @@ class FirCallResolver( return resolvedQualifierPart } - val result = collectCandidates(qualifiedAccess, callee.name) - val reducedCandidates = result.candidates - val nameReference = createResolvedNamedReference( - callee, - callee.name, - result.info, - reducedCandidates, - result.applicability, - qualifiedAccess.explicitReceiver, - ) + var result = collectCandidates(qualifiedAccess, callee.name) if (qualifiedAccess.explicitReceiver == null) { if (!result.applicability.isSuccess) { @@ -217,6 +212,26 @@ class FirCallResolver( qualifiedResolver.reset() } + var functionCallExpected = false + if (result.candidates.isEmpty() && qualifiedAccess !is FirFunctionCall) { + val newResult = collectCandidates(qualifiedAccess, callee.name, CallKind.Function) + if (newResult.candidates.isNotEmpty()) { + result = newResult + functionCallExpected = true + } + } + + val reducedCandidates = result.candidates + val nameReference = createResolvedNamedReference( + callee, + callee.name, + result.info, + reducedCandidates, + result.applicability, + qualifiedAccess.explicitReceiver, + functionCallExpected = functionCallExpected + ) + val referencedSymbol = when (nameReference) { is FirResolvedNamedReference -> nameReference.resolvedSymbol is FirNamedReferenceWithCandidate -> nameReference.candidateSymbol @@ -544,10 +559,34 @@ class FirCallResolver( candidates: Collection, applicability: CandidateApplicability, explicitReceiver: FirExpression? = null, - createResolvedReferenceWithoutCandidateForLocalVariables: Boolean = true + createResolvedReferenceWithoutCandidateForLocalVariables: Boolean = true, + functionCallExpected: Boolean = false ): FirNamedReference { val source = reference.source return when { + functionCallExpected -> { + fun isValueParametersNotEmpty(candidate: Candidate): Boolean { + return (candidate.symbol.fir as? FirFunction)?.valueParameters?.size?.let { it > 0 } ?: false + } + + val candidate = candidates.singleOrNull() + if (candidate != null) { + createErrorReferenceWithExistingCandidate( + candidate, + ConeFunctionCallExpectedError(name, isValueParametersNotEmpty(candidate)), + source, + transformer.resolutionContext, + components.resolutionStageRunner + ) + } else { + buildErrorReference( + callInfo, + ConeFunctionCallExpectedError(name, candidates.any { isValueParametersNotEmpty(it) }), + source + ) + } + } + candidates.isEmpty() -> buildErrorReference( callInfo, ConeUnresolvedNameError(name), diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/diagnostics/FirDiagnostics.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/diagnostics/FirDiagnostics.kt index 42491290520..417b77d07df 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/diagnostics/FirDiagnostics.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/diagnostics/FirDiagnostics.kt @@ -44,6 +44,10 @@ class ConeUnresolvedNameError(val name: Name) : ConeUnresolvedError() { override val reason: String get() = "Unresolved name: $name" } +class ConeFunctionCallExpectedError(val name: Name, val hasValueParameters: Boolean) : ConeDiagnostic() { + override val reason: String get() = "Function call expected: $name(${if (hasValueParameters) "..." else ""})" +} + class ConeHiddenCandidateError( val candidateSymbol: FirBasedSymbol<*> ) : ConeDiagnostic() { diff --git a/compiler/testData/diagnostics/tests/ResolveToJava.fir.kt b/compiler/testData/diagnostics/tests/ResolveToJava.fir.kt index 8abcb8f5f97..bdaf6a08449 100644 --- a/compiler/testData/diagnostics/tests/ResolveToJava.fir.kt +++ b/compiler/testData/diagnostics/tests/ResolveToJava.fir.kt @@ -21,8 +21,8 @@ fun test(l : java.util.List) { val f : java.io.File? = null - Collections.emptyList - Collections.emptyList + Collections.emptyList + Collections.emptyList<Int> Collections.emptyList() Collections.emptyList() diff --git a/compiler/testData/diagnostics/tests/callableReference/bound/functionCallWithoutArguments.fir.kt b/compiler/testData/diagnostics/tests/callableReference/bound/functionCallWithoutArguments.fir.kt deleted file mode 100644 index be9c7e33b9e..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/bound/functionCallWithoutArguments.fir.kt +++ /dev/null @@ -1 +0,0 @@ -fun test() = ("").hashCode::hashCode diff --git a/compiler/testData/diagnostics/tests/callableReference/bound/functionCallWithoutArguments.kt b/compiler/testData/diagnostics/tests/callableReference/bound/functionCallWithoutArguments.kt index a03b0703fd5..3a828b27826 100644 --- a/compiler/testData/diagnostics/tests/callableReference/bound/functionCallWithoutArguments.kt +++ b/compiler/testData/diagnostics/tests/callableReference/bound/functionCallWithoutArguments.kt @@ -1 +1,2 @@ +// FIR_IDENTICAL fun test() = ("").hashCode::hashCode diff --git a/compiler/testData/diagnostics/tests/incompleteCode/kt2014.fir.kt b/compiler/testData/diagnostics/tests/incompleteCode/kt2014.fir.kt index e663bf2568e..87eeb2de8fe 100644 --- a/compiler/testData/diagnostics/tests/incompleteCode/kt2014.fir.kt +++ b/compiler/testData/diagnostics/tests/incompleteCode/kt2014.fir.kt @@ -9,8 +9,8 @@ class Foo { } fun x(f : Foo) { - f.prop - f.bar + f.prop + f.bar f.a() c() diff --git a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt1778.fir.kt b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt1778.fir.kt index 1234da06ded..561121eb688 100644 --- a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt1778.fir.kt +++ b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt1778.fir.kt @@ -7,8 +7,8 @@ import checkSubtype fun main(args : Array) { val x = checkSubtype(args[0]) if(x is java.lang.CharSequence) { - if ("a" == x) x.length else x.length() // OK - if ("a" == x || "b" == x) x.length else x.length() // <– THEN ERROR - if ("a" == x && "a" == x) x.length else x.length() // <– ELSE ERROR + if ("a" == x) x.length else x.length() // OK + if ("a" == x || "b" == x) x.length else x.length() // <– THEN ERROR + if ("a" == x && "a" == x) x.length else x.length() // <– ELSE ERROR } } diff --git a/compiler/testData/diagnostics/tests/recovery/absentLeftHandSide.fir.kt b/compiler/testData/diagnostics/tests/recovery/absentLeftHandSide.fir.kt index 69e0247fd63..a2289e47a1d 100644 --- a/compiler/testData/diagnostics/tests/recovery/absentLeftHandSide.fir.kt +++ b/compiler/testData/diagnostics/tests/recovery/absentLeftHandSide.fir.kt @@ -1,5 +1,5 @@ fun import() { - import a.* + import a.* } fun composite() { @@ -7,9 +7,9 @@ fun composite() { } fun html() { - <html></html> + <html></html> } fun html1() { - <html></html>html + <html></html>html } diff --git a/compiler/testData/diagnostics/tests/regressions/kt10843.fir.kt b/compiler/testData/diagnostics/tests/regressions/kt10843.fir.kt index b756a3e5eb6..3661e09ba59 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt10843.fir.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt10843.fir.kt @@ -1,6 +1,6 @@ // NI_EXPECTED_FILE // See EA-76890 / KT-10843: NPE during analysis -fun lambda(x : Int?) = x?.let l { +fun lambda(x : Int?) = x?.let l { y -> if (y > 0) return@l x y diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/invokeOnVariableWithExtensionFunctionType.fir.kt b/compiler/testData/diagnostics/tests/resolve/invoke/invokeOnVariableWithExtensionFunctionType.fir.kt index 120f937c13c..ed5e1181f3b 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/invokeOnVariableWithExtensionFunctionType.fir.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/invokeOnVariableWithExtensionFunctionType.fir.kt @@ -58,7 +58,7 @@ fun test(a: A, b: B) { b.(foo)() - (b.foo)() + (b.foo)() foo(b) (foo)(b) diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/IsNaming.fir.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/IsNaming.fir.kt deleted file mode 100644 index e133b761ebf..00000000000 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/IsNaming.fir.kt +++ /dev/null @@ -1,37 +0,0 @@ -// FILE: KotlinFile.kt -fun foo(javaClass: JavaClass) { - javaClass.isSomething = !javaClass.isSomething - javaClass.isSomething2 = !javaClass.isSomething2 - - javaClass.something - javaClass.isSomethingWrong - javaClass.somethingWrong - - javaClass.issueFlag - javaClass.isSueFlag -} - -// FILE: JavaClass.java -public class JavaClass { - public boolean isSomething() { - return true; - } - - public void setSomething(boolean value) { - } - - public boolean getIsSomething2() { - return true; - } - - public void setIsSomething2(boolean value) { - } - - public int isSomethingWrong() { - return 1; - } - - public boolean issueFlag() { - return true; - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/IsNaming.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/IsNaming.kt index eaa03f7c860..b47b4ff43e4 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/IsNaming.kt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/IsNaming.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: KotlinFile.kt fun foo(javaClass: JavaClass) { javaClass.isSomething = !javaClass.isSomething diff --git a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDataClassConverters.kt b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDataClassConverters.kt index 2fdf59b80af..3318af34a0d 100644 --- a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDataClassConverters.kt +++ b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDataClassConverters.kt @@ -283,6 +283,14 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert token, ) } + add(FirErrors.FUNCTION_CALL_EXPECTED) { firDiagnostic -> + FunctionCallExpectedImpl( + firDiagnostic.a, + firDiagnostic.b, + firDiagnostic as FirPsiDiagnostic, + token, + ) + } add(FirErrors.SUPER_IS_NOT_AN_EXPRESSION) { firDiagnostic -> SuperIsNotAnExpressionImpl( firDiagnostic as FirPsiDiagnostic, diff --git a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDiagnostics.kt b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDiagnostics.kt index 9898c45f52e..77631895e13 100644 --- a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDiagnostics.kt +++ b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDiagnostics.kt @@ -220,6 +220,12 @@ sealed class KtFirDiagnostic : KtDiagnosticWithPsi { override val diagnosticClass get() = CreatingAnInstanceOfAbstractClass::class } + abstract class FunctionCallExpected : KtFirDiagnostic() { + override val diagnosticClass get() = FunctionCallExpected::class + abstract val functionName: String + abstract val hasValueParameters: Boolean + } + abstract class SuperIsNotAnExpression : KtFirDiagnostic() { override val diagnosticClass get() = SuperIsNotAnExpression::class } diff --git a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDiagnosticsImpl.kt b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDiagnosticsImpl.kt index ac543717dd6..403ca129994 100644 --- a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDiagnosticsImpl.kt +++ b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDiagnosticsImpl.kt @@ -329,6 +329,15 @@ internal class CreatingAnInstanceOfAbstractClassImpl( override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } +internal class FunctionCallExpectedImpl( + override val functionName: String, + override val hasValueParameters: Boolean, + firDiagnostic: FirPsiDiagnostic, + override val token: ValidityToken, +) : KtFirDiagnostic.FunctionCallExpected(), KtAbstractFirDiagnostic { + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) +} + internal class SuperIsNotAnExpressionImpl( firDiagnostic: FirPsiDiagnostic, override val token: ValidityToken, diff --git a/idea/testData/checker/ResolveToJava.fir.kt b/idea/testData/checker/ResolveToJava.fir.kt index 729699a3dbd..f8e7024bb7d 100644 --- a/idea/testData/checker/ResolveToJava.fir.kt +++ b/idea/testData/checker/ResolveToJava.fir.kt @@ -18,8 +18,8 @@ fun test(l : List) { val f : java.io.File? = null - Collections.emptyList - Collections.emptyList + Collections.emptyList + Collections.emptyList<Int> Collections.emptyList() Collections.emptyList()