Revert "[FE 1.0] Take care callable reference candidates with recursive candidate return type"
This reverts commit d04beaa8bb49c99ceb993f3f7b32169c393b39f4.
This commit is contained in:
committed by
teamcity
parent
06deaed3d5
commit
51551998c7
-6
@@ -13910,12 +13910,6 @@ public class DiagnosisCompilerTestFE10TestdataTestGenerated extends AbstractDiag
|
|||||||
runTest("compiler/testData/diagnostics/tests/inference/kt49961.kt");
|
runTest("compiler/testData/diagnostics/tests/inference/kt49961.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
@TestMetadata("kt51844.kt")
|
|
||||||
public void testKt51844() throws Exception {
|
|
||||||
runTest("compiler/testData/diagnostics/tests/inference/kt51844.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kt6175.kt")
|
@TestMetadata("kt6175.kt")
|
||||||
public void testKt6175() throws Exception {
|
public void testKt6175() throws Exception {
|
||||||
|
|||||||
-6
@@ -13910,12 +13910,6 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti
|
|||||||
runTest("compiler/testData/diagnostics/tests/inference/kt49961.kt");
|
runTest("compiler/testData/diagnostics/tests/inference/kt49961.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
@TestMetadata("kt51844.kt")
|
|
||||||
public void testKt51844() throws Exception {
|
|
||||||
runTest("compiler/testData/diagnostics/tests/inference/kt51844.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kt6175.kt")
|
@TestMetadata("kt6175.kt")
|
||||||
public void testKt6175() throws Exception {
|
public void testKt6175() throws Exception {
|
||||||
|
|||||||
-6
@@ -13910,12 +13910,6 @@ public class FirOldFrontendDiagnosticsWithLightTreeTestGenerated extends Abstrac
|
|||||||
runTest("compiler/testData/diagnostics/tests/inference/kt49961.kt");
|
runTest("compiler/testData/diagnostics/tests/inference/kt49961.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
@TestMetadata("kt51844.kt")
|
|
||||||
public void testKt51844() throws Exception {
|
|
||||||
runTest("compiler/testData/diagnostics/tests/inference/kt51844.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kt6175.kt")
|
@TestMetadata("kt6175.kt")
|
||||||
public void testKt6175() throws Exception {
|
public void testKt6175() throws Exception {
|
||||||
|
|||||||
-6
@@ -3129,12 +3129,6 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
|||||||
runTest("compiler/testData/codegen/box/callableReference/kt50172.kt");
|
runTest("compiler/testData/codegen/box/callableReference/kt50172.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
@TestMetadata("kt51844.kt")
|
|
||||||
public void testKt51844() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/box/callableReference/kt51844.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("nested.kt")
|
@TestMetadata("nested.kt")
|
||||||
public void testNested() throws Exception {
|
public void testNested() throws Exception {
|
||||||
|
|||||||
-8
@@ -195,14 +195,6 @@ class DiagnosticReporterByTrackingStrategy(
|
|||||||
SmartCastDiagnostic::class.java -> reportSmartCast(diagnostic as SmartCastDiagnostic)
|
SmartCastDiagnostic::class.java -> reportSmartCast(diagnostic as SmartCastDiagnostic)
|
||||||
UnstableSmartCastDiagnosticError::class.java,
|
UnstableSmartCastDiagnosticError::class.java,
|
||||||
UnstableSmartCastResolutionError::class.java -> reportUnstableSmartCast(diagnostic as UnstableSmartCast)
|
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 -> {
|
VisibilityErrorOnArgument::class.java -> {
|
||||||
diagnostic as VisibilityErrorOnArgument
|
diagnostic as VisibilityErrorOnArgument
|
||||||
val invisibleMember = diagnostic.invisibleMember
|
val invisibleMember = diagnostic.invisibleMember
|
||||||
|
|||||||
+1
-1
@@ -502,7 +502,7 @@ class NewResolutionOldInference(
|
|||||||
extensionReceiverCandidates: List<ReceiverValueWithSmartCastInfo>
|
extensionReceiverCandidates: List<ReceiverValueWithSmartCastInfo>
|
||||||
): MyCandidate = error("${this::class.simpleName} doesn't support candidates with multiple extension receiver candidates")
|
): MyCandidate = error("${this::class.simpleName} doesn't support candidates with multiple extension receiver candidates")
|
||||||
|
|
||||||
override fun createErrorCandidate(reason: ErrorCandidateReason): MyCandidate {
|
override fun createErrorCandidate(): MyCandidate {
|
||||||
throw IllegalStateException("Not supported creating error candidate for the old type inference candidate factory")
|
throw IllegalStateException("Not supported creating error candidate for the old type inference candidate factory")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-2
@@ -19,9 +19,8 @@ package org.jetbrains.kotlin.util;
|
|||||||
import com.intellij.openapi.application.Application;
|
import com.intellij.openapi.application.Application;
|
||||||
import com.intellij.openapi.application.ApplicationManager;
|
import com.intellij.openapi.application.ApplicationManager;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.kotlin.types.error.LazyWrappedTypeComputationException;
|
|
||||||
|
|
||||||
public class ReenteringLazyValueComputationException extends LazyWrappedTypeComputationException {
|
public class ReenteringLazyValueComputationException extends RuntimeException {
|
||||||
public ReenteringLazyValueComputationException() {
|
public ReenteringLazyValueComputationException() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
-3
@@ -8,11 +8,9 @@ package org.jetbrains.kotlin.resolve.calls.components
|
|||||||
import org.jetbrains.kotlin.resolve.calls.inference.ConstraintSystemBuilder
|
import org.jetbrains.kotlin.resolve.calls.inference.ConstraintSystemBuilder
|
||||||
import org.jetbrains.kotlin.resolve.calls.inference.components.NewTypeSubstitutor
|
import org.jetbrains.kotlin.resolve.calls.inference.components.NewTypeSubstitutor
|
||||||
import org.jetbrains.kotlin.resolve.calls.model.*
|
import org.jetbrains.kotlin.resolve.calls.model.*
|
||||||
import org.jetbrains.kotlin.resolve.calls.tower.RecursiveCallableReferenceType
|
|
||||||
import org.jetbrains.kotlin.resolve.calls.tower.VisibilityError
|
import org.jetbrains.kotlin.resolve.calls.tower.VisibilityError
|
||||||
import org.jetbrains.kotlin.resolve.calls.tower.VisibilityErrorOnArgument
|
import org.jetbrains.kotlin.resolve.calls.tower.VisibilityErrorOnArgument
|
||||||
import org.jetbrains.kotlin.resolve.calls.tower.isInapplicable
|
import org.jetbrains.kotlin.resolve.calls.tower.isInapplicable
|
||||||
import org.jetbrains.kotlin.resolve.calls.model.TypeCheckerHasRanIntoRecursion
|
|
||||||
|
|
||||||
class CallableReferenceArgumentResolver(val callableReferenceOverloadConflictResolver: CallableReferenceOverloadConflictResolver) {
|
class CallableReferenceArgumentResolver(val callableReferenceOverloadConflictResolver: CallableReferenceOverloadConflictResolver) {
|
||||||
fun processCallableReferenceArgument(
|
fun processCallableReferenceArgument(
|
||||||
@@ -48,7 +46,6 @@ class CallableReferenceArgumentResolver(val callableReferenceOverloadConflictRes
|
|||||||
val transformedDiagnostic = when (it) {
|
val transformedDiagnostic = when (it) {
|
||||||
is CompatibilityWarning -> CompatibilityWarningOnArgument(argument, it.candidate)
|
is CompatibilityWarning -> CompatibilityWarningOnArgument(argument, it.candidate)
|
||||||
is VisibilityError -> VisibilityErrorOnArgument(argument, it.invisibleMember)
|
is VisibilityError -> VisibilityErrorOnArgument(argument, it.invisibleMember)
|
||||||
is RecursiveCallableReferenceType -> TypeCheckerHasRanIntoRecursion(argument)
|
|
||||||
else -> it
|
else -> it
|
||||||
}
|
}
|
||||||
diagnosticsHolder.addDiagnostic(transformedDiagnostic)
|
diagnosticsHolder.addDiagnostic(transformedDiagnostic)
|
||||||
|
|||||||
+1
-1
@@ -273,7 +273,7 @@ class KotlinCallCompleter(
|
|||||||
constraintSystem.errors.forEach(diagnosticsHolder::addError)
|
constraintSystem.errors.forEach(diagnosticsHolder::addError)
|
||||||
|
|
||||||
if (returnType is ErrorType && returnType.kind == ErrorTypeKind.RECURSIVE_TYPE) {
|
if (returnType is ErrorType && returnType.kind == ErrorTypeKind.RECURSIVE_TYPE) {
|
||||||
diagnosticsHolder.addDiagnostic(TypeCheckerHasRanIntoRecursion())
|
diagnosticsHolder.addDiagnostic(TypeCheckerHasRanIntoRecursion)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+8
-47
@@ -18,15 +18,15 @@ import org.jetbrains.kotlin.resolve.calls.inference.model.ConstraintStorage
|
|||||||
import org.jetbrains.kotlin.resolve.calls.inference.model.TypeVariableTypeConstructor
|
import org.jetbrains.kotlin.resolve.calls.inference.model.TypeVariableTypeConstructor
|
||||||
import org.jetbrains.kotlin.resolve.calls.tasks.ExplicitReceiverKind
|
import org.jetbrains.kotlin.resolve.calls.tasks.ExplicitReceiverKind
|
||||||
import org.jetbrains.kotlin.resolve.calls.tower.*
|
import org.jetbrains.kotlin.resolve.calls.tower.*
|
||||||
import org.jetbrains.kotlin.resolve.calls.util.ErrorCandidateReason
|
|
||||||
import org.jetbrains.kotlin.resolve.descriptorUtil.builtIns
|
import org.jetbrains.kotlin.resolve.descriptorUtil.builtIns
|
||||||
import org.jetbrains.kotlin.resolve.descriptorUtil.isCompanionObject
|
import org.jetbrains.kotlin.resolve.descriptorUtil.isCompanionObject
|
||||||
import org.jetbrains.kotlin.resolve.scopes.receivers.DetailedReceiver
|
import org.jetbrains.kotlin.resolve.scopes.receivers.DetailedReceiver
|
||||||
import org.jetbrains.kotlin.resolve.scopes.receivers.ReceiverValue
|
import org.jetbrains.kotlin.resolve.scopes.receivers.ReceiverValue
|
||||||
import org.jetbrains.kotlin.resolve.scopes.receivers.ReceiverValueWithSmartCastInfo
|
import org.jetbrains.kotlin.resolve.scopes.receivers.ReceiverValueWithSmartCastInfo
|
||||||
import org.jetbrains.kotlin.types.*
|
import org.jetbrains.kotlin.types.*
|
||||||
import org.jetbrains.kotlin.types.error.*
|
import org.jetbrains.kotlin.types.error.ErrorScopeKind
|
||||||
import org.jetbrains.kotlin.types.error.ErrorUtils
|
import org.jetbrains.kotlin.types.error.ErrorUtils
|
||||||
|
import org.jetbrains.kotlin.types.error.ErrorTypeKind
|
||||||
import org.jetbrains.kotlin.types.expressions.CoercionStrategy
|
import org.jetbrains.kotlin.types.expressions.CoercionStrategy
|
||||||
import org.jetbrains.kotlin.types.typeUtil.isUnit
|
import org.jetbrains.kotlin.types.typeUtil.isUnit
|
||||||
import org.jetbrains.kotlin.utils.SmartList
|
import org.jetbrains.kotlin.utils.SmartList
|
||||||
@@ -43,7 +43,7 @@ class CallableReferencesCandidateFactory(
|
|||||||
private val CallableReceiver.asReceiverValueForVisibilityChecks: ReceiverValue
|
private val CallableReceiver.asReceiverValueForVisibilityChecks: ReceiverValue
|
||||||
get() = receiver.receiverValue
|
get() = receiver.receiverValue
|
||||||
|
|
||||||
override fun createErrorCandidate(reason: ErrorCandidateReason): CallableReferenceResolutionCandidate {
|
override fun createErrorCandidate(): CallableReferenceResolutionCandidate {
|
||||||
val errorScope = ErrorUtils.createErrorScope(ErrorScopeKind.SCOPE_FOR_ERROR_RESOLUTION_CANDIDATE, kotlinCall.toString())
|
val errorScope = ErrorUtils.createErrorScope(ErrorScopeKind.SCOPE_FOR_ERROR_RESOLUTION_CANDIDATE, kotlinCall.toString())
|
||||||
val errorDescriptor = errorScope.getContributedFunctions(kotlinCall.rhsName, scopeTower.location).first()
|
val errorDescriptor = errorScope.getContributedFunctions(kotlinCall.rhsName, scopeTower.location).first()
|
||||||
|
|
||||||
@@ -56,36 +56,21 @@ class CallableReferencesCandidateFactory(
|
|||||||
buildTypeWithConversions = kotlinCall is CallableReferenceKotlinCallArgument
|
buildTypeWithConversions = kotlinCall is CallableReferenceKotlinCallArgument
|
||||||
)
|
)
|
||||||
|
|
||||||
val candidate = CallableReferenceResolutionCandidate(
|
return CallableReferenceResolutionCandidate(
|
||||||
errorDescriptor, dispatchReceiver = null, extensionReceiver = null,
|
errorDescriptor, dispatchReceiver = null, extensionReceiver = null,
|
||||||
ExplicitReceiverKind.NO_EXPLICIT_RECEIVER, reflectionCandidateType, callableReferenceAdaptation,
|
ExplicitReceiverKind.NO_EXPLICIT_RECEIVER, reflectionCandidateType, callableReferenceAdaptation,
|
||||||
kotlinCall, expectedType, callComponents, scopeTower, resolutionCallbacks, baseSystem
|
kotlinCall, expectedType, callComponents, scopeTower, resolutionCallbacks, baseSystem
|
||||||
)
|
)
|
||||||
|
|
||||||
when (reason) {
|
|
||||||
ErrorCandidateReason.TYPE_COMPUTATION_RECURSION -> candidate.addDiagnostic(RecursiveCallableReferenceType)
|
|
||||||
ErrorCandidateReason.OTHER -> {}
|
|
||||||
}
|
|
||||||
|
|
||||||
return candidate
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun KotlinType.isErrorRecursiveType(): Boolean {
|
override fun createCandidate(
|
||||||
val unwrapped = if (this is WrappedType && isComputed()) unwrap() else this
|
|
||||||
return unwrapped is ErrorType && unwrapped.kind == ErrorTypeKind.RECURSIVE_TYPE
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun createCandidateInternal(
|
|
||||||
towerCandidate: CandidateWithBoundDispatchReceiver,
|
towerCandidate: CandidateWithBoundDispatchReceiver,
|
||||||
explicitReceiverKind: ExplicitReceiverKind,
|
explicitReceiverKind: ExplicitReceiverKind,
|
||||||
extensionReceiver: ReceiverValueWithSmartCastInfo?
|
extensionReceiver: ReceiverValueWithSmartCastInfo?
|
||||||
): CallableReferenceResolutionCandidate {
|
): CallableReferenceResolutionCandidate {
|
||||||
val dispatchCallableReceiver = towerCandidate.dispatchReceiver?.let {
|
val dispatchCallableReceiver =
|
||||||
toCallableReceiver(it, explicitReceiverKind == ExplicitReceiverKind.DISPATCH_RECEIVER)
|
towerCandidate.dispatchReceiver?.let { toCallableReceiver(it, explicitReceiverKind == ExplicitReceiverKind.DISPATCH_RECEIVER) }
|
||||||
}
|
val extensionCallableReceiver = extensionReceiver?.let { toCallableReceiver(it, explicitReceiverKind == ExplicitReceiverKind.EXTENSION_RECEIVER) }
|
||||||
val extensionCallableReceiver = extensionReceiver?.let {
|
|
||||||
toCallableReceiver(it, explicitReceiverKind == ExplicitReceiverKind.EXTENSION_RECEIVER)
|
|
||||||
}
|
|
||||||
val candidateDescriptor = towerCandidate.descriptor
|
val candidateDescriptor = towerCandidate.descriptor
|
||||||
val diagnostics = SmartList<KotlinCallDiagnostic>()
|
val diagnostics = SmartList<KotlinCallDiagnostic>()
|
||||||
|
|
||||||
@@ -137,30 +122,6 @@ class CallableReferencesCandidateFactory(
|
|||||||
return createCallableReferenceCallCandidate(diagnostics)
|
return createCallableReferenceCallCandidate(diagnostics)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun createCandidate(
|
|
||||||
towerCandidate: CandidateWithBoundDispatchReceiver,
|
|
||||||
explicitReceiverKind: ExplicitReceiverKind,
|
|
||||||
extensionReceiver: ReceiverValueWithSmartCastInfo?
|
|
||||||
): CallableReferenceResolutionCandidate =
|
|
||||||
createRecursionTolerantCandidate(towerCandidate, explicitReceiverKind, extensionReceiver) {
|
|
||||||
createErrorCandidate(ErrorCandidateReason.TYPE_COMPUTATION_RECURSION)
|
|
||||||
}
|
|
||||||
|
|
||||||
private fun createRecursionTolerantCandidate(
|
|
||||||
towerCandidate: CandidateWithBoundDispatchReceiver,
|
|
||||||
explicitReceiverKind: ExplicitReceiverKind,
|
|
||||||
extensionReceiver: ReceiverValueWithSmartCastInfo?,
|
|
||||||
onRecursion: () -> CallableReferenceResolutionCandidate,
|
|
||||||
): CallableReferenceResolutionCandidate =
|
|
||||||
try {
|
|
||||||
val resolutionCandidate = createCandidateInternal(towerCandidate, explicitReceiverKind, extensionReceiver)
|
|
||||||
val returnType = resolutionCandidate.candidate.returnType
|
|
||||||
|
|
||||||
if (returnType == null || !returnType.isErrorRecursiveType()) resolutionCandidate else onRecursion()
|
|
||||||
} catch (e: LazyWrappedTypeComputationException) {
|
|
||||||
onRecursion()
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The function is called only inside [NoExplicitReceiverScopeTowerProcessor] with [TowerData.BothTowerLevelAndContextReceiversGroup].
|
* The function is called only inside [NoExplicitReceiverScopeTowerProcessor] with [TowerData.BothTowerLevelAndContextReceiversGroup].
|
||||||
* This case involves only [SimpleCandidateFactory].
|
* This case involves only [SimpleCandidateFactory].
|
||||||
|
|||||||
+2
-8
@@ -116,14 +116,8 @@ class WrongCountOfTypeArguments(
|
|||||||
override fun report(reporter: DiagnosticReporter) = reporter.onTypeArguments(this)
|
override fun report(reporter: DiagnosticReporter) = reporter.onTypeArguments(this)
|
||||||
}
|
}
|
||||||
|
|
||||||
class TypeCheckerHasRanIntoRecursion(val onArgument: KotlinCallArgument? = null) : KotlinCallDiagnostic(INAPPLICABLE) {
|
object TypeCheckerHasRanIntoRecursion : KotlinCallDiagnostic(INAPPLICABLE) {
|
||||||
override fun report(reporter: DiagnosticReporter) {
|
override fun report(reporter: DiagnosticReporter) = reporter.onCall(this)
|
||||||
return if (onArgument != null) {
|
|
||||||
reporter.onCallArgument(onArgument, this)
|
|
||||||
} else {
|
|
||||||
reporter.onCall(this)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Callable reference resolution
|
// Callable reference resolution
|
||||||
|
|||||||
+1
-2
@@ -15,7 +15,6 @@ import org.jetbrains.kotlin.resolve.calls.inference.addSubsystemFromArgument
|
|||||||
import org.jetbrains.kotlin.resolve.calls.inference.model.ConstraintStorage
|
import org.jetbrains.kotlin.resolve.calls.inference.model.ConstraintStorage
|
||||||
import org.jetbrains.kotlin.resolve.calls.tasks.ExplicitReceiverKind
|
import org.jetbrains.kotlin.resolve.calls.tasks.ExplicitReceiverKind
|
||||||
import org.jetbrains.kotlin.resolve.calls.tower.*
|
import org.jetbrains.kotlin.resolve.calls.tower.*
|
||||||
import org.jetbrains.kotlin.resolve.calls.util.ErrorCandidateReason
|
|
||||||
import org.jetbrains.kotlin.resolve.descriptorUtil.hasDynamicExtensionAnnotation
|
import org.jetbrains.kotlin.resolve.descriptorUtil.hasDynamicExtensionAnnotation
|
||||||
import org.jetbrains.kotlin.resolve.scopes.receivers.ReceiverValueWithSmartCastInfo
|
import org.jetbrains.kotlin.resolve.scopes.receivers.ReceiverValueWithSmartCastInfo
|
||||||
import org.jetbrains.kotlin.types.error.ErrorUtils
|
import org.jetbrains.kotlin.types.error.ErrorUtils
|
||||||
@@ -164,7 +163,7 @@ class SimpleCandidateFactory(
|
|||||||
return candidate
|
return candidate
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun createErrorCandidate(reason: ErrorCandidateReason): SimpleResolutionCandidate {
|
override fun createErrorCandidate(): SimpleResolutionCandidate {
|
||||||
val errorScope = ErrorUtils.createErrorScope(ErrorScopeKind.SCOPE_FOR_ERROR_RESOLUTION_CANDIDATE, kotlinCall.toString())
|
val errorScope = ErrorUtils.createErrorScope(ErrorScopeKind.SCOPE_FOR_ERROR_RESOLUTION_CANDIDATE, kotlinCall.toString())
|
||||||
val errorDescriptor = if (kotlinCall.callKind == KotlinCallKind.VARIABLE) {
|
val errorDescriptor = if (kotlinCall.callKind == KotlinCallKind.VARIABLE) {
|
||||||
errorScope.getContributedVariables(kotlinCall.name, scopeTower.location)
|
errorScope.getContributedVariables(kotlinCall.name, scopeTower.location)
|
||||||
|
|||||||
@@ -154,7 +154,6 @@ object ResolvedUsingNewFeatures : ResolutionDiagnostic(RESOLVED_NEED_PRESERVE_CO
|
|||||||
object UnstableSmartCastDiagnostic : ResolutionDiagnostic(UNSTABLE_SMARTCAST)
|
object UnstableSmartCastDiagnostic : ResolutionDiagnostic(UNSTABLE_SMARTCAST)
|
||||||
object HiddenExtensionRelatedToDynamicTypes : ResolutionDiagnostic(HIDDEN)
|
object HiddenExtensionRelatedToDynamicTypes : ResolutionDiagnostic(HIDDEN)
|
||||||
object HiddenDescriptor : ResolutionDiagnostic(HIDDEN)
|
object HiddenDescriptor : ResolutionDiagnostic(HIDDEN)
|
||||||
object RecursiveCallableReferenceType : ResolutionDiagnostic(INAPPLICABLE)
|
|
||||||
|
|
||||||
object InvokeConventionCallNoOperatorModifier : ResolutionDiagnostic(CONVENTION_ERROR)
|
object InvokeConventionCallNoOperatorModifier : ResolutionDiagnostic(CONVENTION_ERROR)
|
||||||
object InfixCallNoInfixModifier : ResolutionDiagnostic(CONVENTION_ERROR)
|
object InfixCallNoInfixModifier : ResolutionDiagnostic(CONVENTION_ERROR)
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ package org.jetbrains.kotlin.resolve.calls.tower
|
|||||||
import org.jetbrains.kotlin.name.Name
|
import org.jetbrains.kotlin.name.Name
|
||||||
import org.jetbrains.kotlin.progress.ProgressIndicatorAndCompilationCanceledStatus
|
import org.jetbrains.kotlin.progress.ProgressIndicatorAndCompilationCanceledStatus
|
||||||
import org.jetbrains.kotlin.resolve.calls.tasks.ExplicitReceiverKind
|
import org.jetbrains.kotlin.resolve.calls.tasks.ExplicitReceiverKind
|
||||||
import org.jetbrains.kotlin.resolve.calls.util.ErrorCandidateReason
|
|
||||||
import org.jetbrains.kotlin.resolve.descriptorUtil.HIDES_MEMBERS_NAME_LIST
|
import org.jetbrains.kotlin.resolve.descriptorUtil.HIDES_MEMBERS_NAME_LIST
|
||||||
import org.jetbrains.kotlin.resolve.scopes.HierarchicalScope
|
import org.jetbrains.kotlin.resolve.scopes.HierarchicalScope
|
||||||
import org.jetbrains.kotlin.resolve.scopes.ImportingScope
|
import org.jetbrains.kotlin.resolve.scopes.ImportingScope
|
||||||
@@ -48,7 +47,7 @@ interface CandidateFactory<out C : Candidate> {
|
|||||||
extensionReceiver: ReceiverValueWithSmartCastInfo?
|
extensionReceiver: ReceiverValueWithSmartCastInfo?
|
||||||
): C
|
): C
|
||||||
|
|
||||||
fun createErrorCandidate(reason: ErrorCandidateReason = ErrorCandidateReason.OTHER): C
|
fun createErrorCandidate(): C
|
||||||
|
|
||||||
fun createCandidate(
|
fun createCandidate(
|
||||||
towerCandidate: CandidateWithBoundDispatchReceiver,
|
towerCandidate: CandidateWithBoundDispatchReceiver,
|
||||||
|
|||||||
-8
@@ -1,8 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
|
||||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.jetbrains.kotlin.resolve.calls.util
|
|
||||||
|
|
||||||
enum class ErrorCandidateReason { TYPE_COMPUTATION_RECURSION, OTHER }
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
// WITH_STDLIB
|
|
||||||
|
|
||||||
abstract class Foo {
|
|
||||||
abstract fun contains(x: Int);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ERROR: Type checking has run into a recursive problem. Easiest workaround: specify types of your declarations explicitly
|
|
||||||
fun Foo.contains(vararg xs: Int) = xs.forEach(this::contains)
|
|
||||||
|
|
||||||
fun box(): String {
|
|
||||||
object : Foo() {
|
|
||||||
override fun contains(x: Int) {}
|
|
||||||
}.contains(1)
|
|
||||||
return "OK"
|
|
||||||
}
|
|
||||||
@@ -26,7 +26,7 @@ infix fun filter(filter: (R, Any?) -> Boolean): Delegate<R, T>
|
|||||||
class GitLabChangesProcessor: DatabaseEntity {
|
class GitLabChangesProcessor: DatabaseEntity {
|
||||||
var buildProcessors by <!DEBUG_INFO_EXPRESSION_TYPE("Delegate<GitLabChangesProcessor, kotlin.collections.MutableCollection<GitLabBuildProcessor>>"), TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM_ERROR!>child_many(
|
var buildProcessors by <!DEBUG_INFO_EXPRESSION_TYPE("Delegate<GitLabChangesProcessor, kotlin.collections.MutableCollection<GitLabBuildProcessor>>"), TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM_ERROR!>child_many(
|
||||||
GitLabBuildProcessor::class.java,
|
GitLabBuildProcessor::class.java,
|
||||||
<!TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM_ERROR, TYPE_MISMATCH!>GitLabBuildProcessor::<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>processor<!><!>
|
GitLabBuildProcessor::processor
|
||||||
)<!>
|
)<!>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ infix fun filter(filter: (R, Any?) -> Boolean): Delegate<R, T>
|
|||||||
class GitLabChangesProcessor: DatabaseEntity {
|
class GitLabChangesProcessor: DatabaseEntity {
|
||||||
var buildProcessors by <!DEBUG_INFO_EXPRESSION_TYPE("Delegate<GitLabChangesProcessor, kotlin.collections.MutableCollection<GitLabBuildProcessor>>"), TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM_ERROR!>child_many(
|
var buildProcessors by <!DEBUG_INFO_EXPRESSION_TYPE("Delegate<GitLabChangesProcessor, kotlin.collections.MutableCollection<GitLabBuildProcessor>>"), TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM_ERROR!>child_many(
|
||||||
GitLabBuildProcessor::class.java,
|
GitLabBuildProcessor::class.java,
|
||||||
<!TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM_ERROR, TYPE_MISMATCH!>GitLabBuildProcessor::<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>processor<!><!>
|
GitLabBuildProcessor::processor
|
||||||
)<!>
|
)<!>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
// WITH_STDLIB
|
|
||||||
|
|
||||||
abstract class Foo {
|
|
||||||
}
|
|
||||||
|
|
||||||
// ERROR: Type checking has run into a recursive problem. Easiest workaround: specify types of your declarations explicitly
|
|
||||||
fun Foo.contains(vararg xs: Int) = xs.forEach(this::contains)
|
|
||||||
|
|
||||||
fun box(): String {
|
|
||||||
return "OK"
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
// WITH_STDLIB
|
|
||||||
|
|
||||||
abstract class Foo {
|
|
||||||
}
|
|
||||||
|
|
||||||
// ERROR: Type checking has run into a recursive problem. Easiest workaround: specify types of your declarations explicitly
|
|
||||||
fun Foo.contains(vararg xs: Int) = xs.forEach(<!TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM_ERROR, TYPE_MISMATCH!>this::<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>contains<!><!>)
|
|
||||||
|
|
||||||
fun box(): String {
|
|
||||||
return "OK"
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
package
|
|
||||||
|
|
||||||
public fun box(): kotlin.String
|
|
||||||
public fun Foo.contains(/*0*/ vararg xs: kotlin.Int /*kotlin.IntArray*/): kotlin.Unit
|
|
||||||
|
|
||||||
public abstract class Foo {
|
|
||||||
public constructor Foo()
|
|
||||||
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
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
// FULL_JDK
|
||||||
|
// WITH_STDLIB
|
||||||
|
|
||||||
|
// FILE: Schematic.kt
|
||||||
|
class Schematic {
|
||||||
|
var name: String? = null
|
||||||
|
|
||||||
|
var error: String? = null
|
||||||
|
|
||||||
|
override fun toString(): String {
|
||||||
|
return name!!
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// FILE: SortedListModel.java
|
||||||
|
import java.util.Comparator;
|
||||||
|
|
||||||
|
public class SortedListModel<T> {
|
||||||
|
public SortedListModel(Comparator<? super T> comparator) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// FILE: main.kt
|
||||||
|
val model = SortedListModel<Schematic>(Comparator.comparing { b1: Schematic ->
|
||||||
|
when {
|
||||||
|
b1.error != null -> 2
|
||||||
|
b1.name!!.contains(":") -> 1
|
||||||
|
else -> 0
|
||||||
|
}
|
||||||
|
}.thenComparing { b1: Schematic -> b1.name!! })
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
// FIR_IDENTICAL
|
|
||||||
// FULL_JDK
|
// FULL_JDK
|
||||||
// WITH_STDLIB
|
// WITH_STDLIB
|
||||||
|
|
||||||
|
|||||||
Generated
-6
@@ -13916,12 +13916,6 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
|||||||
runTest("compiler/testData/diagnostics/tests/inference/kt49961.kt");
|
runTest("compiler/testData/diagnostics/tests/inference/kt49961.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
@TestMetadata("kt51844.kt")
|
|
||||||
public void testKt51844() throws Exception {
|
|
||||||
runTest("compiler/testData/diagnostics/tests/inference/kt51844.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("kt6175.kt")
|
@TestMetadata("kt6175.kt")
|
||||||
public void testKt6175() throws Exception {
|
public void testKt6175() throws Exception {
|
||||||
|
|||||||
-6
@@ -3033,12 +3033,6 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
|||||||
runTest("compiler/testData/codegen/box/callableReference/kt50172.kt");
|
runTest("compiler/testData/codegen/box/callableReference/kt50172.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
@TestMetadata("kt51844.kt")
|
|
||||||
public void testKt51844() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/box/callableReference/kt51844.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("nested.kt")
|
@TestMetadata("nested.kt")
|
||||||
public void testNested() throws Exception {
|
public void testNested() throws Exception {
|
||||||
|
|||||||
-6
@@ -3129,12 +3129,6 @@ public class IrBlackBoxCodegenTestGenerated extends AbstractIrBlackBoxCodegenTes
|
|||||||
runTest("compiler/testData/codegen/box/callableReference/kt50172.kt");
|
runTest("compiler/testData/codegen/box/callableReference/kt50172.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
@TestMetadata("kt51844.kt")
|
|
||||||
public void testKt51844() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/box/callableReference/kt51844.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("nested.kt")
|
@TestMetadata("nested.kt")
|
||||||
public void testNested() throws Exception {
|
public void testNested() throws Exception {
|
||||||
|
|||||||
-5
@@ -2658,11 +2658,6 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes
|
|||||||
runTest("compiler/testData/codegen/box/callableReference/kt50172.kt");
|
runTest("compiler/testData/codegen/box/callableReference/kt50172.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("kt51844.kt")
|
|
||||||
public void testKt51844() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/box/callableReference/kt51844.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("nested.kt")
|
@TestMetadata("nested.kt")
|
||||||
public void testNested() throws Exception {
|
public void testNested() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/callableReference/nested.kt");
|
runTest("compiler/testData/codegen/box/callableReference/nested.kt");
|
||||||
|
|||||||
-8
@@ -1,8 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
|
||||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package org.jetbrains.kotlin.types.error
|
|
||||||
|
|
||||||
abstract class LazyWrappedTypeComputationException : RuntimeException()
|
|
||||||
-6
@@ -1983,12 +1983,6 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest {
|
|||||||
runTest("compiler/testData/codegen/box/callableReference/kt50172.kt");
|
runTest("compiler/testData/codegen/box/callableReference/kt50172.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
@TestMetadata("kt51844.kt")
|
|
||||||
public void testKt51844() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/box/callableReference/kt51844.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("nested.kt")
|
@TestMetadata("nested.kt")
|
||||||
public void testNested() throws Exception {
|
public void testNested() throws Exception {
|
||||||
|
|||||||
-6
@@ -2025,12 +2025,6 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest {
|
|||||||
runTest("compiler/testData/codegen/box/callableReference/kt50172.kt");
|
runTest("compiler/testData/codegen/box/callableReference/kt50172.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
@TestMetadata("kt51844.kt")
|
|
||||||
public void testKt51844() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/box/callableReference/kt51844.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("nested.kt")
|
@TestMetadata("nested.kt")
|
||||||
public void testNested() throws Exception {
|
public void testNested() throws Exception {
|
||||||
|
|||||||
-5
@@ -1808,11 +1808,6 @@ public class IrCodegenBoxWasmTestGenerated extends AbstractIrCodegenBoxWasmTest
|
|||||||
runTest("compiler/testData/codegen/box/callableReference/kt50172.kt");
|
runTest("compiler/testData/codegen/box/callableReference/kt50172.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("kt51844.kt")
|
|
||||||
public void testKt51844() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/box/callableReference/kt51844.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("nested.kt")
|
@TestMetadata("nested.kt")
|
||||||
public void testNested() throws Exception {
|
public void testNested() throws Exception {
|
||||||
runTest("compiler/testData/codegen/box/callableReference/nested.kt");
|
runTest("compiler/testData/codegen/box/callableReference/nested.kt");
|
||||||
|
|||||||
-6
@@ -2077,12 +2077,6 @@ public class NativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTest
|
|||||||
runTest("compiler/testData/codegen/box/callableReference/kt50172.kt");
|
runTest("compiler/testData/codegen/box/callableReference/kt50172.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
@TestMetadata("kt51844.kt")
|
|
||||||
public void testKt51844() throws Exception {
|
|
||||||
runTest("compiler/testData/codegen/box/callableReference/kt51844.kt");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("nested.kt")
|
@TestMetadata("nested.kt")
|
||||||
public void testNested() throws Exception {
|
public void testNested() throws Exception {
|
||||||
|
|||||||
Reference in New Issue
Block a user