[FIR] Fix redundant modality modifier checker
Fixed function FirDeclaration.hasBody() and some others improvement
This commit is contained in:
committed by
Mikhail Glukhikh
parent
a988234bbf
commit
a8ff5d17dc
+24
-10
@@ -1,3 +1,27 @@
|
||||
// Interface
|
||||
interface Interface {
|
||||
// Redundant
|
||||
<!REDUNDANT_MODALITY_MODIFIER!>open<!> val gav: Int
|
||||
get() = 42
|
||||
// Redundant
|
||||
<!REDUNDANT_MODALITY_MODIFIER!>abstract<!> fun foo()
|
||||
// Redundant
|
||||
private <!REDUNDANT_MODALITY_MODIFIER!>final<!> fun bar() {}
|
||||
}
|
||||
interface B {
|
||||
<!REDUNDANT_MODALITY_MODIFIER!>abstract<!> var bar: Unit
|
||||
<!REDUNDANT_MODALITY_MODIFIER!>abstract<!> fun foo()
|
||||
}
|
||||
|
||||
expect abstract class AbstractClass : Foo {
|
||||
abstract override fun foo()
|
||||
|
||||
abstract fun bar()
|
||||
|
||||
abstract val baz: Int
|
||||
}
|
||||
|
||||
|
||||
// Abstract
|
||||
abstract class Base {
|
||||
// Redundant final
|
||||
@@ -23,16 +47,6 @@ open class OpenDerived : Base() {
|
||||
}
|
||||
// Redundant final
|
||||
<!REDUNDANT_MODALITY_MODIFIER!>final<!> class Final
|
||||
// Interface
|
||||
interface Interface {
|
||||
// Redundant
|
||||
<!REDUNDANT_MODALITY_MODIFIER!>abstract<!> fun foo()
|
||||
// Redundant
|
||||
private <!REDUNDANT_MODALITY_MODIFIER!>final<!> fun bar() {}
|
||||
// Redundant
|
||||
<!REDUNDANT_MODALITY_MODIFIER!>open<!> val gav: Int
|
||||
get() = 42
|
||||
}
|
||||
// Derived interface
|
||||
interface Derived : Interface {
|
||||
// Redundant
|
||||
|
||||
+33
-12
@@ -1,4 +1,37 @@
|
||||
FILE: RedundantModalityModifierChecker.kt
|
||||
public abstract interface Interface : R|kotlin/Any| {
|
||||
public open val gav: R|kotlin/Int|
|
||||
public get(): R|kotlin/Int| {
|
||||
^ Int(42)
|
||||
}
|
||||
|
||||
public abstract fun foo(): R|kotlin/Unit|
|
||||
|
||||
private final fun bar(): R|kotlin/Unit| {
|
||||
}
|
||||
|
||||
}
|
||||
public abstract interface B : R|kotlin/Any| {
|
||||
public abstract var bar: R|kotlin/Unit|
|
||||
public get(): R|kotlin/Unit|
|
||||
public set(value: R|kotlin/Unit|): R|kotlin/Unit|
|
||||
|
||||
public abstract fun foo(): R|kotlin/Unit|
|
||||
|
||||
}
|
||||
public abstract expect class AbstractClass : R|ERROR CLASS: Symbol not found, for `Foo`| {
|
||||
public expect constructor(): R|AbstractClass| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public abstract expect override fun foo(): R|kotlin/Unit|
|
||||
|
||||
public abstract expect fun bar(): R|kotlin/Unit|
|
||||
|
||||
public abstract expect val baz: R|kotlin/Int|
|
||||
public get(): R|kotlin/Int|
|
||||
|
||||
}
|
||||
public abstract class Base : R|kotlin/Any| {
|
||||
public constructor(): R|Base| {
|
||||
super<R|kotlin/Any|>()
|
||||
@@ -42,18 +75,6 @@ FILE: RedundantModalityModifierChecker.kt
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
}
|
||||
public abstract interface Interface : R|kotlin/Any| {
|
||||
public abstract fun foo(): R|kotlin/Unit|
|
||||
|
||||
private final fun bar(): R|kotlin/Unit| {
|
||||
}
|
||||
|
||||
public open val gav: R|kotlin/Int|
|
||||
public get(): R|kotlin/Int| {
|
||||
^ Int(42)
|
||||
}
|
||||
|
||||
}
|
||||
public abstract interface Derived : R|Interface| {
|
||||
public open override fun foo(): R|kotlin/Unit| {
|
||||
|
||||
Reference in New Issue
Block a user