[FE 1.0] Take care callable reference candidates with recursive candidate return type

^KT-51844 Fixed
This commit is contained in:
Victor Petukhov
2022-04-17 11:35:28 +03:00
committed by teamcity
parent ec6ec20728
commit 9f31f074da
34 changed files with 218 additions and 55 deletions
@@ -195,6 +195,14 @@ class DiagnosticReporterByTrackingStrategy(
SmartCastDiagnostic::class.java -> reportSmartCast(diagnostic as SmartCastDiagnostic)
UnstableSmartCastDiagnosticError::class.java,
UnstableSmartCastResolutionError::class.java -> reportUnstableSmartCast(diagnostic as UnstableSmartCast)
TypeCheckerHasRanIntoRecursion::class.java -> {
diagnostic as TypeCheckerHasRanIntoRecursion
val argumentExpression =
diagnostic.onArgument?.psiCallArgument?.valueArgument?.getArgumentExpression()
if (argumentExpression != null) {
trace.report(TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM.errorFactory.on(argumentExpression))
}
}
VisibilityErrorOnArgument::class.java -> {
diagnostic as VisibilityErrorOnArgument
val invisibleMember = diagnostic.invisibleMember
@@ -502,7 +502,7 @@ class NewResolutionOldInference(
extensionReceiverCandidates: List<ReceiverValueWithSmartCastInfo>
): MyCandidate = error("${this::class.simpleName} doesn't support candidates with multiple extension receiver candidates")
override fun createErrorCandidate(): MyCandidate {
override fun createErrorCandidate(reason: ErrorCandidateReason): MyCandidate {
throw IllegalStateException("Not supported creating error candidate for the old type inference candidate factory")
}
@@ -19,8 +19,9 @@ package org.jetbrains.kotlin.util;
import com.intellij.openapi.application.Application;
import com.intellij.openapi.application.ApplicationManager;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.kotlin.types.error.LazyWrappedTypeComputationException;
public class ReenteringLazyValueComputationException extends RuntimeException {
public class ReenteringLazyValueComputationException extends LazyWrappedTypeComputationException {
public ReenteringLazyValueComputationException() {
}