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:
committed by
Space Team
parent
8f9614c1fb
commit
7615d863d5
+2
-1
@@ -1,5 +1,6 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE -PARAMETER_NAME_CHANGED_ON_OVERRIDE
|
||||
// SCOPE_DUMP: KA:contains
|
||||
// RENDER_DIAGNOSTICS_FULL_TEXT
|
||||
|
||||
// FILE: A.java
|
||||
abstract public class A implements java.util.Collection<String> {
|
||||
@@ -9,7 +10,7 @@ abstract public class A implements java.util.Collection<String> {
|
||||
|
||||
// FILE: main.kt
|
||||
abstract class KA : A() {
|
||||
override fun contains(x: String) = false
|
||||
override fun <!ACCIDENTAL_OVERRIDE_CLASH_BY_JVM_SIGNATURE!>contains<!>(x: String) = false
|
||||
}
|
||||
|
||||
fun foo(a: A, ka: KA) {
|
||||
|
||||
Reference in New Issue
Block a user