[Wasm] Restore binary compatibility of PlatformDiagnosticSuppressor
Keep the original shouldReportUnusedParameter method without BindingContext parameter ^KT-58188 Fixed
This commit is contained in:
committed by
teamcity
parent
e39d9c2c35
commit
dc4aa8c15e
+2
-1
@@ -780,7 +780,8 @@ class ControlFlowInformationProviderImpl private constructor(
|
||||
|
||||
if (functionDescriptor.isExpect || functionDescriptor.isActual ||
|
||||
functionDescriptor.isEffectivelyExternal() ||
|
||||
!diagnosticSuppressor.shouldReportUnusedParameter(variableDescriptor, trace.bindingContext)
|
||||
!diagnosticSuppressor.shouldReportUnusedParameter(variableDescriptor, trace.bindingContext) ||
|
||||
!diagnosticSuppressor.shouldReportUnusedParameter(variableDescriptor)
|
||||
) return
|
||||
|
||||
when (val owner = element.parent.parent) {
|
||||
|
||||
+8
-1
@@ -25,11 +25,15 @@ import org.jetbrains.kotlin.resolve.BindingContext
|
||||
|
||||
@DefaultImplementation(PlatformDiagnosticSuppressor.Default::class)
|
||||
interface PlatformDiagnosticSuppressor : PlatformSpecificExtension<PlatformDiagnosticSuppressor>{
|
||||
fun shouldReportUnusedParameter(parameter: VariableDescriptor, bindingContext: BindingContext): Boolean
|
||||
// Function without binding context is kept for binary compatibility
|
||||
// Diagnostic should be suppressed if any of two overloads return false
|
||||
fun shouldReportUnusedParameter(parameter: VariableDescriptor): Boolean
|
||||
fun shouldReportUnusedParameter(parameter: VariableDescriptor, bindingContext: BindingContext): Boolean = true
|
||||
|
||||
fun shouldReportNoBody(descriptor: CallableMemberDescriptor): Boolean
|
||||
|
||||
object Default : PlatformDiagnosticSuppressor {
|
||||
override fun shouldReportUnusedParameter(parameter: VariableDescriptor): Boolean = true
|
||||
override fun shouldReportUnusedParameter(parameter: VariableDescriptor, bindingContext: BindingContext): Boolean = true
|
||||
|
||||
override fun shouldReportNoBody(descriptor: CallableMemberDescriptor): Boolean = true
|
||||
@@ -40,6 +44,9 @@ class CompositePlatformDiagnosticSuppressor(private val suppressors: List<Platfo
|
||||
override fun shouldReportUnusedParameter(parameter: VariableDescriptor, bindingContext: BindingContext): Boolean =
|
||||
suppressors.all { it.shouldReportUnusedParameter(parameter, bindingContext) }
|
||||
|
||||
override fun shouldReportUnusedParameter(parameter: VariableDescriptor): Boolean =
|
||||
suppressors.all { it.shouldReportUnusedParameter(parameter) }
|
||||
|
||||
override fun shouldReportNoBody(descriptor: CallableMemberDescriptor): Boolean =
|
||||
suppressors.all { it.shouldReportNoBody(descriptor) }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user