From 6fab1305e9c1af8e96f8f656c71765c3f819f66d Mon Sep 17 00:00:00 2001 From: Mikhael Bogdanov Date: Fri, 12 Mar 2021 14:29:52 +0100 Subject: [PATCH] Fix compilation after @JvmDefault deprecation Suppress could be removed after switch to -Xjvm-default=all --- .../org/jetbrains/kotlin/codegen/BaseExpressionCodegen.kt | 1 - .../org/jetbrains/kotlin/codegen/ExpressionCodegen.java | 8 ++++++++ .../extensions/internal/NonStableExtensionPoints.kt | 7 ++++++- .../resolve/extensions/SyntheticResolveExtension.kt | 2 ++ 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/BaseExpressionCodegen.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/BaseExpressionCodegen.kt index 7d3f01ec4b9..73bd403a8b7 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/BaseExpressionCodegen.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/BaseExpressionCodegen.kt @@ -51,7 +51,6 @@ interface BaseExpressionCodegen { fun consumeReifiedOperationMarker(typeParameter: TypeParameterMarker) - @JvmDefault fun putReifiedOperationMarkerIfTypeIsReifiedParameter(type: KotlinTypeMarker, operationKind: OperationKind) { with(typeSystem) { val (typeParameter, second) = extractReificationArgument(type) ?: return diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/ExpressionCodegen.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/ExpressionCodegen.java index cb23cd5c181..ce866f9870f 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/ExpressionCodegen.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/ExpressionCodegen.java @@ -88,6 +88,7 @@ import org.jetbrains.kotlin.synthetic.SyntheticJavaPropertyDescriptor; import org.jetbrains.kotlin.types.*; import org.jetbrains.kotlin.types.checker.ClassicTypeSystemContextImpl; import org.jetbrains.kotlin.types.expressions.DoubleColonLHS; +import org.jetbrains.kotlin.types.model.KotlinTypeMarker; import org.jetbrains.kotlin.types.model.TypeParameterMarker; import org.jetbrains.kotlin.types.typesApproximation.CapturedTypeApproximationKt; import org.jetbrains.kotlin.util.OperatorNameConventions; @@ -5532,4 +5533,11 @@ The "returned" value of try expression with no finally is either the last expres parentCodegen.getReifiedTypeParametersUsages().addUsedReifiedParameter(typeParameterDescriptor.getName().asString()); } } + + @Override + public void putReifiedOperationMarkerIfTypeIsReifiedParameter( + @NotNull KotlinTypeMarker type, @NotNull ReifiedTypeInliner.OperationKind operationKind + ) { + BaseExpressionCodegen.DefaultImpls.putReifiedOperationMarkerIfTypeIsReifiedParameter(this, type, operationKind); + } } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/extensions/internal/NonStableExtensionPoints.kt b/compiler/frontend/src/org/jetbrains/kotlin/extensions/internal/NonStableExtensionPoints.kt index 565daab4ee0..7bc444df3ea 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/extensions/internal/NonStableExtensionPoints.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/extensions/internal/NonStableExtensionPoints.kt @@ -52,6 +52,7 @@ interface TypeResolutionInterceptorExtension { @InternalNonStableExtensionPoints interface CallResolutionInterceptorExtension { + @Suppress("DEPRECATION") @JvmDefault fun interceptCandidates( candidates: Collection, @@ -63,6 +64,7 @@ interface CallResolutionInterceptorExtension { tracing: TracingStrategy ): Collection = candidates + @Suppress("DEPRECATION") @JvmDefault fun interceptFunctionCandidates( candidates: Collection, @@ -74,6 +76,7 @@ interface CallResolutionInterceptorExtension { location: LookupLocation ): Collection = candidates + @Suppress("DEPRECATION") @JvmDefault fun interceptFunctionCandidates( candidates: Collection, @@ -87,6 +90,7 @@ interface CallResolutionInterceptorExtension { extensionReceiver: ReceiverValueWithSmartCastInfo? ): Collection = candidates + @Suppress("DEPRECATION") @JvmDefault fun interceptVariableCandidates( candidates: Collection, @@ -98,6 +102,7 @@ interface CallResolutionInterceptorExtension { location: LookupLocation ): Collection = candidates + @Suppress("DEPRECATION") @JvmDefault fun interceptVariableCandidates( candidates: Collection, @@ -111,7 +116,7 @@ interface CallResolutionInterceptorExtension { extensionReceiver: ReceiverValueWithSmartCastInfo? ): Collection = candidates - @Suppress("DeprecatedCallableAddReplaceWith") + @Suppress("DeprecatedCallableAddReplaceWith", "DEPRECATION") @Deprecated("Please use dedicated interceptVariableCandidates and interceptFunctionCandidates instead") @JvmDefault fun interceptCandidates( diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/extensions/SyntheticResolveExtension.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/extensions/SyntheticResolveExtension.kt index 2a0f755bcb4..d619c7c8e90 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/extensions/SyntheticResolveExtension.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/extensions/SyntheticResolveExtension.kt @@ -145,6 +145,7 @@ interface SyntheticResolveExtension { fun getSyntheticFunctionNames(thisDescriptor: ClassDescriptor): List = emptyList() + @Suppress("DEPRECATION") @JvmDefault fun getSyntheticPropertiesNames(thisDescriptor: ClassDescriptor): List = emptyList() @@ -155,6 +156,7 @@ interface SyntheticResolveExtension { * or null in case it needs to run resolution and inference and/or it is very costly. * Override this method if resolution started to fail with recursion. */ + @Suppress("DEPRECATION") @JvmDefault fun getPossibleSyntheticNestedClassNames(thisDescriptor: ClassDescriptor): List? = getSyntheticNestedClassNames(thisDescriptor)