FE: report DECLARATION_CANT_BE_INLINED at 'inline' modifier

#KT-44022 Fixed
This commit is contained in:
Mikhail Glukhikh
2021-11-25 10:45:54 +03:00
parent 4df937ff7f
commit 2f1d415e4d
10 changed files with 111 additions and 42 deletions
@@ -14,17 +14,17 @@ abstract class A {
inline final fun good4() {}
<!DECLARATION_CANT_BE_INLINED!>inline open protected fun wrong1()<!> {}
<!DECLARATION_CANT_BE_INLINED!>inline<!> open protected fun wrong1() {}
<!DECLARATION_CANT_BE_INLINED!>inline open public fun wrong2()<!> {}
<!DECLARATION_CANT_BE_INLINED!>inline<!> open public fun wrong2() {}
<!DECLARATION_CANT_BE_INLINED!>inline open fun wrong3()<!> {}
<!DECLARATION_CANT_BE_INLINED!>inline<!> open fun wrong3() {}
<!DECLARATION_CANT_BE_INLINED!>inline abstract protected fun wrong4()<!>
<!DECLARATION_CANT_BE_INLINED!>inline<!> abstract protected fun wrong4()
<!DECLARATION_CANT_BE_INLINED!>inline abstract public fun wrong5()<!>
<!DECLARATION_CANT_BE_INLINED!>inline<!> abstract public fun wrong5()
<!DECLARATION_CANT_BE_INLINED!>inline abstract fun wrong6()<!>
<!DECLARATION_CANT_BE_INLINED!>inline<!> abstract fun wrong6()
}
@@ -32,17 +32,17 @@ interface B {
inline private fun good1() {}
<!DECLARATION_CANT_BE_INLINED!>inline fun wrong1()<!> {}
<!DECLARATION_CANT_BE_INLINED!>inline<!> fun wrong1() {}
<!DECLARATION_CANT_BE_INLINED!>inline open fun wrong2()<!> {}
<!DECLARATION_CANT_BE_INLINED!>inline<!> open fun wrong2() {}
<!DECLARATION_CANT_BE_INLINED!>inline open public fun wrong3()<!> {}
<!DECLARATION_CANT_BE_INLINED!>inline<!> open public fun wrong3() {}
<!DECLARATION_CANT_BE_INLINED!>inline open fun wrong4()<!> {}
<!DECLARATION_CANT_BE_INLINED!>inline<!> open fun wrong4() {}
<!DECLARATION_CANT_BE_INLINED!>inline fun wrong5()<!>
<!DECLARATION_CANT_BE_INLINED!>inline<!> fun wrong5()
<!DECLARATION_CANT_BE_INLINED!>inline public fun wrong6()<!>
<!DECLARATION_CANT_BE_INLINED!>inline<!> public fun wrong6()
<!DECLARATION_CANT_BE_INLINED!>inline fun wrong7()<!>
<!DECLARATION_CANT_BE_INLINED!>inline<!> fun wrong7()
}
@@ -35,12 +35,12 @@ class CDerived : IBase {
open class COpen : IBase {
<!OVERRIDE_BY_INLINE!>override inline final fun foo()<!> {}
<!DECLARATION_CANT_BE_INLINED!>override inline fun bar()<!> {}
override <!DECLARATION_CANT_BE_INLINED!>inline<!> fun bar() {}
<!OVERRIDE_BY_INLINE!>override inline final fun <<!REIFIED_TYPE_PARAMETER_IN_OVERRIDE!>reified<!> T> qux(x: T)<!> {}
open class COpenNested : IBase {
<!OVERRIDE_BY_INLINE!>override inline final fun foo()<!> {}
<!DECLARATION_CANT_BE_INLINED!>override inline fun bar()<!> {}
override <!DECLARATION_CANT_BE_INLINED!>inline<!> fun bar() {}
<!OVERRIDE_BY_INLINE!>override inline final fun <<!REIFIED_TYPE_PARAMETER_IN_OVERRIDE!>reified<!> T> qux(x: T)<!> {}
}
@@ -53,7 +53,7 @@ open class COpen : IBase {
fun aMethod() {
open class COpenLocal : IBase {
<!OVERRIDE_BY_INLINE!>override inline final fun foo()<!> {}
<!DECLARATION_CANT_BE_INLINED!>override inline fun bar()<!> {}
override <!DECLARATION_CANT_BE_INLINED!>inline<!> fun bar() {}
<!OVERRIDE_BY_INLINE!>override inline final fun <<!REIFIED_TYPE_PARAMETER_IN_OVERRIDE!>reified<!> T> qux(x: T)<!> {}
}
}
@@ -17,23 +17,23 @@ final class FinalProperty {
open class OpenProperty {
<!DECLARATION_CANT_BE_INLINED!>inline open val valProp: Int<!>
<!DECLARATION_CANT_BE_INLINED!>inline<!> open val valProp: Int
get() = 1
<!DECLARATION_CANT_BE_INLINED!>open val valProp_1: Int<!>
inline get() = 1
open val valProp_1: Int
<!DECLARATION_CANT_BE_INLINED!>inline<!> get() = 1
<!DECLARATION_CANT_BE_INLINED!>inline open var varProp: Int<!>
<!DECLARATION_CANT_BE_INLINED!>inline<!> open var varProp: Int
get() = 1
set(p: Int) {}
<!DECLARATION_CANT_BE_INLINED!>open var varProp_2: Int<!>
open var varProp_2: Int
get() = 1
inline set(p: Int) {}
<!DECLARATION_CANT_BE_INLINED!>inline<!> set(p: Int) {}
}
interface AbstractProperty {
<!DECLARATION_CANT_BE_INLINED!>inline abstract val valProp: Int<!>
<!DECLARATION_CANT_BE_INLINED!>inline abstract var varProp: Int<!>
<!DECLARATION_CANT_BE_INLINED!>inline<!> abstract val valProp: Int
<!DECLARATION_CANT_BE_INLINED!>inline<!> abstract var varProp: Int
}