FIR: Refine processing special functions with erased parameters
This commit is contained in:
+2
-3
@@ -415,7 +415,7 @@ class JavaClassUseSiteMemberScope(
|
||||
?.symbol as? FirNamedFunctionSymbol
|
||||
?: unwrappedSubstitutionOverride.symbol
|
||||
val originalDeclaredFunction = declaredMemberScope.getFunctions(naturalName).firstOrNull {
|
||||
it.hasSameJvmDescriptorButDoesNotOverride(functionFromSupertypeWithErasedParameterType)
|
||||
it.hasSameJvmDescriptor(functionFromSupertypeWithErasedParameterType) && it.hasErasedParameters()
|
||||
} ?: return false
|
||||
val renamedDeclaredFunction = buildJavaMethodCopy(originalDeclaredFunction.fir as FirJavaMethod) {
|
||||
name = naturalName
|
||||
@@ -451,11 +451,10 @@ class JavaClassUseSiteMemberScope(
|
||||
return false
|
||||
}
|
||||
|
||||
private fun FirNamedFunctionSymbol.hasSameJvmDescriptorButDoesNotOverride(
|
||||
private fun FirNamedFunctionSymbol.hasSameJvmDescriptor(
|
||||
builtinWithErasedParameters: FirNamedFunctionSymbol
|
||||
): Boolean {
|
||||
return fir.computeJvmDescriptor(includeReturnType = false) == builtinWithErasedParameters.fir.computeJvmDescriptor(includeReturnType = false)
|
||||
&& overrideChecker.isOverriddenFunction(this, builtinWithErasedParameters)
|
||||
}
|
||||
|
||||
private fun processOverridesForFunctionsWithDifferentJvmName(
|
||||
|
||||
Vendored
+1
-1
@@ -115,5 +115,5 @@ fun main() {
|
||||
x[0]
|
||||
x.size
|
||||
x.remove("")
|
||||
x.remove(1)
|
||||
x.remove(<!ARGUMENT_TYPE_MISMATCH!>1<!>)
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -102,5 +102,5 @@ fun main() {
|
||||
<!OPERATOR_MODIFIER_REQUIRED!>x[0]<!>
|
||||
x.size
|
||||
x.remove("")
|
||||
x.remove(1)
|
||||
x.remove(<!ARGUMENT_TYPE_MISMATCH!>1<!>)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user