FIR checker: warn redundant open in interface members properly

This commit is contained in:
Jinseong Jeon
2021-01-14 13:29:36 -08:00
committed by Mikhail Glukhikh
parent 2e8b5f2380
commit 6b5ee6c9f9
9 changed files with 47 additions and 44 deletions
@@ -1,10 +1,10 @@
// !DIAGNOSTICS: -CONFLICTING_JVM_DECLARATIONS
interface One {
public open fun foo() : Int
public <!REDUNDANT_OPEN_IN_INTERFACE!>open<!> fun foo() : Int
private fun boo() = 10
}
interface Two {
public open fun foo() : Int
public <!REDUNDANT_OPEN_IN_INTERFACE!>open<!> fun foo() : Int
}
interface OneImpl : One {
@@ -1,10 +0,0 @@
interface My {
open fun foo()
open fun bar() {}
<!REDUNDANT_MODIFIER!>open<!> abstract fun baz(): Int
open val x: Int
open val y: String
get() = ""
<!REDUNDANT_MODIFIER!>open<!> abstract val z: Double
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
interface My {
<!REDUNDANT_OPEN_IN_INTERFACE!>open<!> fun foo()
open fun bar() {}
@@ -1,16 +0,0 @@
// KT-880 Overload resolution ambiguity
public interface I {
open fun test() : Unit
}
abstract public class A() {
open public fun test() : Unit {
}
}
public open class T() : A(), I {
open fun main() : Unit {
test() // Test no "Overload resolution ambiguity" is here
}
}
+1
View File
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// KT-880 Overload resolution ambiguity
public interface I {