K2: add ACCIDENTAL_OVERRIDE_CLASH_BY_JVM_SIGNATURE for clashing functions

This diagnostic is reported on an explicitly-declared function which
overrides a regular Java function with the same signature as a hidden
one from the same scope.

#KT-64846 Fixed
This commit is contained in:
Mikhail Glukhikh
2024-01-22 18:41:45 +01:00
committed by Space Team
parent 8f9614c1fb
commit 7615d863d5
19 changed files with 138 additions and 4 deletions
@@ -565,7 +565,7 @@ class JavaClassUseSiteMemberScope(
symbol = newSymbol
dispatchReceiverType = klass.defaultType()
}.apply {
initialSignatureAttr = original
initialSignatureAttr = explicitlyDeclaredFunctionWithErasedValueParameters.fir
isHiddenToOvercomeSignatureClash = true
}
// Collect synthetic function which is a hidden copy of declared one with unerased parameters